1. sqlc
18,467 stars · active November 2026 · MIT
You write a query in a .sql file with a name and a return shape; sqlc reads your schema and generates a typed Go function. No ORM between you and the database, no surprise N+1, and a compile error when a column disappears. It is the best-liked tool in this category by some distance.
Strengths
- The SQL that runs is the SQL you wrote
- A schema change breaks the build rather than production
- No runtime dependency at all
Trade-offs
- Dynamic filters are awkward: conditional WHERE clauses fight the model
- You write every query, including the dull ones
- Nothing above the database layer
Best for: Teams who like SQL and want the compiler to check it.
