一切都在标题中.是否有"Pythonic"方式(我的意思是,没有"纯SQL"查询)来使用SQLAlchemy定义SQL视图?
谢谢你的帮助,
通常我像这样连接/查询
class MyTable(Base):
__tablename__ = 'mytable'
__table_args__ = {'schema': 'tables'}
id = Column(Integer, primary_key=True)
salutation = Column(VARCHAR(1))
def __init__(self, salutation):
self.salutation = salutation
def load():
""""""
Session = sessionmaker(bind=engine)
session = Session()
for i in session.query(MyTable).order_by(MyTable.id):
entries.append(i.__dict__)
session.close()
Run Code Online (Sandbox Code Playgroud)
但是我如何在没有任何键的情况下查询(PostgreSQL)数据库视图?