Open vaxorcist opened 5 years ago
This is indeed a great idea! Of course, this depends on the chosen database dialect. Not all supported databases support transactional DDL. IMHO PostgreSQL is the only one, so the transaction should only be created by this dialect.
If you have an error in your database model (e.g. incompatible data types on primary and foreign key) and you execute the generated DDL SQL script, the resulting database will be incomplete.
The same problem exists with migration scripts for database updates ("Current db changes")
I suggest enclosing generated scripts in a Transaction, so that you will have either a complete action or nothing at all.