Add the ability to show the sql generated by a migration
See original GitHub issueIt should be good to add a command which helps to show the SQL generated by a migration. This feature is something special for Django. I like Laravel but I don’t see anything like this when I need to show the SQL of a migration.
Example:
masonite-orm sqlmigration migration_for_users_table
Output:
BEGIN;
CREATE TABLE users (
id serial NOT NULL PRIMARY KEY,
name varchar(150) NOT NULL
);
COMMIT;
You can check for Django using the link below https://docs.djangoproject.com/en/3.1/ref/django-admin/#django-admin-sqlmigrate
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Show SQL generated by pending migrations in rails without ...
Very interesting question! I found this way: Assume your migration placed in file db/migrate/20160102210050_create_items.rb and called ...
Read more >Applying Migrations - EF Core - Microsoft Learn
The recommended way to deploy migrations to a production database is by generating SQL scripts. The advantages of this strategy include the ...
Read more >Generating migrations in SSMS - SQL Change Automation 4
1. Make a change to the database · 2. Navigate to the Generate migrations page · 3. Optionally, filter the migrations · 4....
Read more >3 Ways to View and Log the SQL Generated by Entity ...
Here's a way that you can log the SQL generated from EF Core 5. Add the method LogTo() where you've configured Entity Framework...
Read more >Generating SQL Scripts (a.k.a. “Offline Mode”)
A major capability of Alembic is to generate migrations as SQL scripts, ... TABLE account ADD COLUMN last_transaction_date TIMESTAMP WITHOUT TIME ZONE; ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You should be able to pass the dry parameter and then inside the schema class see if dry is set and then just print to_sql()
Depends on how you are running the commands. You can also add it to the orm.py file and run it as “python orm your:command”