Creating a View while joining two tables in Alchemy

不打扰是莪最后的温柔 提交于 2021-02-11 14:46:30

问题


I m trying to join two tables and inserting the data in a view in PostgreSQL. While i debug I can see my data but when i check my DB there is no creating of a view. ALso the is nothing as error and i cannot find what's missing.

engine = create_engine(DATABASE_URI)
view = Table('testing', MetaData())

session = get_db_session()

result=session.query(Policy_table,Join_table).filter(Policy_table.name==Join_table.policy_name).all()
session.commit()

create_view = CreateView(view ,result)
engine.execute(create_view)

Any help will be appreciated.

来源:https://stackoverflow.com/questions/60811651/creating-a-view-while-joining-two-tables-in-alchemy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!