News for hackers. Stuff that matters.
Re:ORMs are nice but they are the wrong abstraction by gmac on Thursday February 01, 2024 @05:20AM (#39214453)
ORMs suck, but raw SQL embedded in your code sucks too.

This might be good time to plug my Postgres/TypeScript non-ORM: https://jawj.github.io/zapatos/.

I should say I also like what I've seen of https://kysely.dev/ and https://pgtyped.dev/.

Re:ORMs are nice but they are the wrong abstraction by ejflick on Thursday February 01, 2024 @06:17AM (#39214775)
I've found embedding raw SQL into my code has been beneficial in two ways:

1. Hot reloading code. As a Java developer, this is important for prototyping as I can iterate quicker.

2. Clarity. I can read exactly what's going on and I know exactly what query is being executed.

Re:ORMs are nice but they are the wrong abstraction by PH95VuimJjqBqy on Thursday February 01, 2024 @10:42AM (#39217116)
> ORMs suck, but raw SQL embedded in your code sucks too.

_strongly_ disagree and I bet anyone who has this opinion can't articulate a good, concrete, reason for it. The best they're going to come up with is FUD about changing table names, which is one of those theoretical things that very rarely manifests itself in reality.

Re:ORMs are nice but they are the wrong abstraction by iccananea on Thursday February 01, 2024 @08:51PM (#39223969)
Agreed, but tools like https://sqlc.dev, which I mention in the article, are a good trade-off that allows you to have verified, testable, SQL in your code.