Ensure SQLModel and SQLAlchemy Alembic migration parody with automated tests. #1917
Unanswered
peterHoburg
asked this question in
Questions
Replies: 1 comment
-
|
parity != parody |
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.
-
First Check
Commit to Help
Example Code
NADescription
Add tests that implement the same model in SQLModel and SQLAlchemy, then runs an Alembic migration against an array of databases. This is one way to find disparities in the underlying models generated by SQLModel.
Using Alembic to test the generated models deltas is a good real-world test. Moving from existing SQLAlchemy models to SQLModel's and running migrations is going to be a very common use case.
Wanted Solution
Create a set of isolated docker containers that run sets of Alembic migrations and see if there are any deltas.
Example workflow:
This could be done on a set of different DBs that SQLAlchemy supports.
Wanted Code
NAAlternatives
Directly comparing the generated SQLAlchemy and SQLModel model's could be a solution, but it lacks the real-world use case and added complexity of using Alembic.
Operating System
Linux
Operating System Details
Docker
SQLModel Version
0.0.4
Python Version
3.9
Additional Context
I would be happy to set up these types of tests as this is my exact real-world use case.
Beta Was this translation helpful? Give feedback.
All reactions