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
Option to execute the migration using an SQL file #184
Comments
++ It would be nice to have a conversion layer that is able to reads raw SQL migrations and outputs the same thing expressed as pgroll operations. btw what we have as of today is a way to execute any SQL migration, it's just we don't guarantee zero downtime for those: https://github.com/xataio/pgroll/tree/main/docs#raw-sql |
In a scenario where you want to switch migration suites the raw SQL option although nice doesn't allow to have an initializer migration to run an idempotent schema migration. Is there a way to do something along the lines of:
|
We have a raw SQL operation that allows you to run any arbitrary SQL for the migration: https://github.com/xataio/pgroll/tree/main/docs#raw-sql. It requires inlining the SQL statements, but otherwise, it looks pretty similar to what you are describing 🙂 |
I've a crazy idea. What about creating an LLM prompt to translate the SQL statement into the JSON file format? If you like the idea, I can give it a try. |
@EmadMokhtar That's an interesting idea! We recently discussed the possibility of doing something like this. If we are able to convert any arbitrary SQL DDL to pgroll format it would be a step forward. In some cases, it's possible that the user still needs to provide some extra info (like the |
Hello,
I really appreciate how well
pgroll
works with JSON files. It would be even more convenient if there was an option to specify an SQL file for migration.For instance, it would be great if you could use the following command:
./pgroll --postgres-url "postgres://{user}:{password}@{IP}:{port}/{DB}" start 01_create_table.sql --label create_table_11102023 --schema stateless_user_info
This way, you could create a schema named 'stateless_user_info_create_table_11102023' while keeping everything else the same.
Best regards,
Althaf
The text was updated successfully, but these errors were encountered: