News for hackers. Stuff that matters.
Re:Some opinionated thoughts on SQL databases by aargh_aargh on Wednesday March 31, 2021 @04:51AM (#26644929)
> why isn’t data definition — which is a much better fit, in my opinion, for a declarative model — also declarative?

My opinion on this one point (apart from DDL being ossified by the ISO standards) is that DDL being imperative is useful because it's used in migrations and imperative approach gives you more control over protecting existing data (i.e. not just the schema).

Some contrived examples: 1) shortening a varchar - are you sure you want to just trim the values or do you want to have the option of doing something with them? 2) renaming a column - would have to be a explicit, a special case in declarative DDL 3) dropping a column - maybe you want to transform the existing values instead of just throwing them away

Sure, it could all be probably handled even in a declarative DDL. My point is that in declarative DDL you would have to think to explicitly protect your data. In imperative DDL you see what you are doing.

Re:Some opinionated thoughts on SQL databases by erik_seaberg on Wednesday March 31, 2021 @05:00AM (#26644987)
What I'd like to see is: here is the desired schema, please compare it to the old schema and propose what to do that doesn't irreversibly destroy any information unless we say to.