Do you recommend using alembic with raw SQL files and exectue()? #1740
Unanswered
ddxv
asked this question in
Usage Questions
Replies: 1 comment
-
|
Hi, Alembic revision model is quite open ened so it can be adapted to use sql files instead of commands. Do note that alembic has an "offline" mode where it can generate the sql from the commands without executing anything on the db, so you could have both. Also recently an user with a similar use case opened this discussion that you may find useful. There is a final example whre the sql handling was automated #1545 |
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.
-
Hello, I'm looking around for something to do db migrations and found alembic. I wanted something that would let me store my migrations in
.sqlfiles rather than text strings in python. This would help me with readability, formatting and linting. Additionally, I saw "Generating SQL Scripts" section, but that would be the opposite, instead I will have SQL scripts that I want Alembic to ingest.I saw that there is use of
execute()which can handle SQL, but it wasn't covered in the tutorial, so I was wondering if what I'm looking for is an uncommon use of alembic?Just want to make sure I'm not going about using the tool in a way it's not intended.
Beta Was this translation helpful? Give feedback.
All reactions