Replies: 1 comment
-
In most cases, you shouldn't define your own base. If you do, you don't need to pass the metadata, you need to pass the base. Make sure to derive the base from Flask-SQLAlchemy's db = SQLAlkchemy(model_class=Base) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have been playing around with SQLAlchemy 2.0 and was wondering what the idiomatic way to correctly provide metadata for table creation is now? Currently I am passing Base.metadata as a keyword parameter to SQLAlchemy when creating but the metadata of some tables is missing and I've been unable to troubleshoot why.
Moving forward, will automatically sourcing the metadata from DeclarativeBase be something flask-sqlalchemy will do itself?
Beta Was this translation helpful? Give feedback.
All reactions