Query builders
Let you write SQL through a typed API in your own language, checked by the compiler, and map results to typed rows without tracking objects afterwards.
How they work
A query builder models SQL itself rather than objects. In jOOQ you write select(...).from(AUTHOR).join(BOOK)... in Java, against classes generated from the live database schema, so a renamed column breaks the build instead of production. Drizzle does the same in TypeScript from tables declared in code (“If you know SQL, you know Drizzle”), Kysely is a type-safe TypeScript query builder inspired by Knex, and SQLAlchemy Core is the expression language underneath the SQLAlchemy ORM.
There is no session and no lazy loading: every query and every write is explicit, so what runs is what you wrote. Related data comes back through joins, or through nested collections built in one statement, such as jOOQ’s MULTISET or Drizzle’s relational queries, which always produce one SQL statement. Pick this kind when the team thinks in SQL and wants type safety without an object model to keep in sync.
Technologies
What all object-relational mapping have in common →
jOOQOpen sourceA Java library that models SQL as a type-safe API: a code generator reads your database schema into Java classes, and you write queries against them that the compiler checks.| Open source | Drizzle Team | Apache 2.0 | 2026-10-08 | |
jOOQ | Open source | Data Geekery GmbH | Apache 2.0 with open-source databases; commercial licence for commercial databases | 2026-10-08 |
Sources
- jOOQ README: an internal DSL and source code generator modelling SQL as a type-safe Java API
- jOOQ manual: MULTISET value constructor
- Drizzle ORM docs: Why Drizzle? (SQL-like and relational query APIs)
- Kysely docs: Introduction (type-safe TypeScript SQL query builder)
- SQLAlchemy 2.1 docs: Overview (the SQL Expression Language is a toolkit on its own)