Drizzle ORM
A TypeScript library that declares tables in code and queries them through a typed API shaped like SQL, plus a relational API for nested data that always compiles to a single SQL statement.
- What it is
- Object-relational mapping (query builders)
- Type
- Open source
- Made by
- Drizzle Team
- License
- Apache 2.0
- Facts checked
- 8 October 2026
What it is
Drizzle calls itself “a headless TypeScript ORM”, and its pitch is “If you know SQL, you know Drizzle”. You declare tables with functions such as pgTable, mysqlTable or sqliteTable, and the column types flow into every query: db.select().from(countries).leftJoin(cities, eq(cities.countryId, countries.id)) reads like the SQL it produces, and the result is typed to the columns you selected. There are no entity classes, no session and no change tracking; inserts, updates and deletes are explicit statements. Next to the SQL-like API sits the relational Queries API (db.query.users.findMany({ with: { posts: true } })), which returns nested objects and, per the docs, always outputs exactly one SQL query, so loading relations can’t turn into N+1 round trips.
Drizzle Kit, a companion CLI, generates SQL migration files from changes to the schema, applies them, pushes a schema straight to a database, pulls a schema from an existing one and opens Drizzle Studio. The library has zero dependencies and targets serverless and edge runtimes. The docs cover PostgreSQL, MySQL and SQLite and services built on them such as Neon, PlanetScale and Turso, plus SingleStore, SQL Server and CockroachDB. The stable line is 0.45; version 1.0, with a second version of the relational API, has been a release candidate since April 2026. In March 2026 PlanetScale hired the whole core team to work on Drizzle full time.
Why teams pick it
- Queries mirror SQL, so there is little new to learn and the generated SQL is predictable
- End-to-end TypeScript types from the table declarations, without a separate schema language or code generation step
- The relational API returns nested results in a single SQL statement, avoiding N+1 queries
- Small, with zero dependencies, which suits serverless functions and edge runtimes
Watch out for
- No unit of work, identity map or change tracking: domain logic has to issue every write itself
- Still before 1.0 in October 2026: the 1.0 release candidate changes the relational API and the upgrade needs a migration
- Schemas are dialect-specific (
pgTable,mysqlTable), so moving to another database means rewriting the table declarations
Alternatives
What all query builders have in common →How it fits with other technologies
Declare two tables and run a typed left join on PostgreSQL · ts
import { eq } from "drizzle-orm";
import { drizzle } from "drizzle-orm/node-postgres";
import { integer, pgTable, serial, varchar } from "drizzle-orm/pg-core";
export const countries = pgTable("countries", {
id: serial().primaryKey(),
name: varchar({ length: 256 }),
});
export const cities = pgTable("cities", {
id: serial().primaryKey(),
name: varchar({ length: 256 }),
countryId: integer("country_id").references(() => countries.id),
});
const db = drizzle(process.env.DATABASE_URL!);
// select ... from countries left join cities on cities.country_id = countries.id where countries.id = 10
const rows = await db
.select()
.from(countries)
.leftJoin(cities, eq(cities.countryId, countries.id))
.where(eq(countries.id, 10));
// rows: { countries: { id; name }; cities: { id; name; countryId } | null }[]See it in a real stack
No architecture uses Drizzle ORM yet. Drop it into the playground and wire it up yourself.Open playground →Where it came from2020–2026
Drizzle started with Andrii Sherman, who in 2020 wrote an ORM called Drizzle in Java. Seeing the need for the same kind of tool in TypeScript, he and Oleksandr (Alex) Blokh pivoted it to TypeScript; the first code for drizzle-orm was written in 2021, and its first npm release came that September. Dan Kochetov later rewrote the library into the API it has today and built the first version of relational queries.
The team’s position was that tools like Django’s or Spring’s are better called data frameworks: you build a project around them. Drizzle set out to be a library you build with instead, staying close to SQL so developers learn one thing rather than SQL plus a framework’s API. The relational Queries API was added for the cases where SQL is awkward, such as nested results, while keeping the rule of one SQL statement per query.
For years Drizzle ran on more than 100 sponsors. In March 2026 PlanetScale hired the entire core team so they could work on it full time, with PlanetScale becoming its biggest backer. Version 1.0 entered beta in November 2025 and reached release candidate in April 2026.
Why it’s built this way
- SQL-like at its core
- Other ORMs abstract SQL away, which the team saw as a double learning curve: SQL and the framework. Mirroring SQL keeps the full power of the database with almost nothing new to learn.
- A library, not a data framework
- The team wanted developers to build projects with Drizzle rather than around it, so it has no required project structure and its tools are opt-in.
- One SQL statement per relational query
- Nested results are where SQL-like code gets awkward, so the Queries API was added, but it always emits a single statement, which keeps round trips predictable on serverless databases.
- Types from TypeScript declarations, zero dependencies
- Declaring tables in TypeScript gives types without a separate schema language or generator, and having no dependencies keeps it small enough for serverless and edge runtimes.
Timeline
- 2020
Andrii Sherman writes a Drizzle ORM in Java
- 2021
First drizzle-orm release on npm, in September
- 2025
Drizzle 1.0 beta in November
- 2026
PlanetScale hires the Drizzle core team in March
- 2026
Drizzle 1.0 release candidate in April
Sources9 · facts checked 8 October 2026
- Drizzle ORM docs: Why Drizzle? (SQL-like and relational APIs, exactly one SQL query, zero dependencies)
- Drizzle ORM docs: Relational queries (a single SQL statement)
- Drizzle ORM docs: Select (joins, partial selects)
- Drizzle ORM docs: Migrations with Drizzle Kit (generate, migrate, push, pull, studio)
- Drizzle ORM docs: Get started with PostgreSQL (drizzle-orm/node-postgres)
- Drizzle docs index (llms.txt: PostgreSQL, MySQL, SQLite, SingleStore, Turso, PlanetScale, MSSQL, CockroachDB guides)
- Drizzle ORM docs: Upgrading to Drizzle v1 (release candidate)
- Drizzle docs: Sustainability (PlanetScale hires the core team)
- GitHub: drizzle-team/drizzle-orm (Apache 2.0)
