|
|
|
|
|
by lmm
479 days ago
|
|
> Most of the time you'll either have grossly inefficient multi-roundtrip query code (hidden from you) Or you spend 5 minutes actually putting some effort in to configuring your ORM. Maybe spend 30 minutes learning if it's your first time. People will spend weeks handwriting SQL to save hours of ORM tuning. |
|
The sweet spot is typesafe sql libraries. You write your raw sql and library deduces the return type from the database and gives you typesafety (sqlx is really good for this, sqlc for go is similar). It gives you almost all the benefits of ORMs with almost no downsides.