3 ms·
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/ https:/
by gmac 3y ago
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/ https://jawj.github.io/zapatos/.
I should say I also like what I've seen of https://kysely.dev/ https://kysely.dev/ and https://pgtyped.dev/ https://pgtyped.dev/.
- ejflick 3y agoI'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.
- PH95VuimJjqBqy 3y ago> 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.
- iccananea 3y agoAgreed, but tools like https://sqlc.dev 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.