News for hackers. Stuff that matters.
Re:SQL Anti-Patterns You Should Avoid by 0xbadcafebee on Saturday October 18, 2025 @12:04PM (#45628370)
`select *` is bad for many reasons, but the biggest is that the "contract" your code has with the remote data store isn't immutable. The database can change, for many different reasons, independent of your code. If you want to write reliable code, you need to make as few assumptions as possible. One of those assumptions is what the remote schema is.
Re:SQL Anti-Patterns You Should Avoid by hvb2 on Saturday October 18, 2025 @01:00PM (#45628739)
Sure but columns can change data types too which 'select column's doesn't protect you from either
Re:SQL Anti-Patterns You Should Avoid by layer8 on Saturday October 18, 2025 @01:46PM (#45629115)
A column changing its data type is generally considering a breaking change for the schema (for obvious reasons), while adding more columns isn’t. Backwards-compatible schema evolution isn’t practical without the latter — you’d have to add a new secondary table whenever you want to add more columns.

This mirrors how adding additional fields to an object type in a programming language usually isn’t considered a breaking change, but changing the type of an existing field is.