Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multiple databases #26

Merged
merged 1 commit into from
Jun 16, 2024
Merged

support multiple databases #26

merged 1 commit into from
Jun 16, 2024

Conversation

davidism
Copy link
Member

Support Flask-SQLAlchemy-Lite and plain SQLAlchemy, in addition to Flask-SQLAlchemy. Add metadatas and engines params to the Alembic init. For Flask-SQLAlchemy-Lite, only metadatas must be passed, db.engines is used automatically. For SQLAlchemy, metadatas and engines must be passed. For Flask-SQLAlchemy, db.metadata and db.engines are used automatically.

Support multiple databases, and multiple metadata per database. More than one metadata object can be passed to metadatas. A dict maps names to one or more metadatas. Corresponding engines must also be configured. If multiple databases are configured, Alembic's multidb template will be used.

support multiple metadatas and engines
support flask-sqlalchemy-lite
support plain sqlalchemy
@davidism davidism merged commit c1393e3 into main Jun 16, 2024
8 checks passed
@davidism davidism deleted the multidb branch June 16, 2024 05:29
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant