2 ms·
ORMs have other selling points. Primarily, it looks like code and works with tooling designed for code. So changing a column name or type, for example, is pret
by roflyear 3y ago
ORMs have other selling points. Primarily, it looks like code and works with tooling designed for code.
So changing a column name or type, for example, is pretty easy to refactor, which may not be true for SQL queries and may take significant testing.
Additionally, ORMs allow you to easily hook into things (post-commit, etc) that is often useful, and to define custom things, like JSON serialization with custom types, without a massive amount of work.
But yes, you make great points I think.
- toomanydoubts 3y ago>So changing a column name or type, for example, is pretty easy to refactor, which may not be true for SQL queries and may take significant testing. You can also get that with raw sql on the right ecosystem. I once developed a simple application using hasql and hasql-th(on Haskell). Very close to raw sql strings but with type checking at compile time. Feels like you're driving a lambo.
- roflyear 3y agoI'll have to check that out. Languages I use don't have that type of tooling that I'm aware of :) Have used Haskell before, but... far from extensively!