Open flyly0755 opened 1 month ago
I'd like to bump this, and would like to add that it also maybe a bug:
ViewTest.__table__.create(engine)
This code should be useable as a View is just a special type of Table for sqlalchemy, which is the reason why it gets decalared in a similar way to it using create_view(). But if I execute this, it results in the creation of a table and not a view, which cannot be intended.
In addition the following should work, but results in an error because the view is created not respecting the arguments given using the tables argument.
Base.metadata.create_all(bind=engine, tables=[ViewTest.__table__])
In the same way the view is also created wrongly when executing:
Base.metadata.create_all(bind=engine, tables=[TableTest.__table__])
This has to be a buggy behavior in my understanding.
So after creating TableTest with code
How to individually create view ViewTest?