News for hackers. Stuff that matters.
Re:SQL Reserved Words – The Empirical List by Varriount on Wednesday October 11, 2023 @02:00PM (#37847977)
Could you expand on the declarative schema features? Isn't SQL more or less declarative by default?
Re:SQL Reserved Words – The Empirical List by LikesPwsh on Wednesday October 11, 2023 @04:13PM (#37849687)
You 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/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.

Re:SQL Reserved Words – The Empirical List by rjbwork on Thursday October 12, 2023 @09:37AM (#37856936)
>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.