3 ms·
Could you expand on the declarative schema features? Isn't SQL more or less declarative by default?
by Varriount 3y ago
Could you expand on the declarative schema features? Isn't SQL more or less declarative by default?
- LikesPwsh 3y agoYou can compare the database schema in source control against what's been deployed, and automatically generate deployment scripts. https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpa... The APIs were historically part of Visual Studio, and only split out into dacfx recently. Someone braver than me could consider automated deployment from github actions etc. The hard part is that a lot of database schema changes cause data truncation (e.g. reducing the size of a column or re-ordering columns). You still need someone to review the generated code if it throws an error for potential data loss.
- rjbwork 3y ago>You still need someone to review the generated code if it throws an error for potential data loss. Yeah, exactly what I meant by the terraform-like plan/apply stages. You generate the change script and save it as your "plan", and then have an apply step that takes a backup and runs the script.