问题
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