Drizzle
orm.drizzle.team- Category
- Developer Tools
- Rank
- No. 739Tools index
Previous survey · No. 728 ·
- Pricing
- Open Source
- Type
- TOOL
- Use case
- Coding
- Interfaces
- SDK
- Builder
- drizzle-team
- GitHub
- 36.2k stars
- Latest release
- v1.0.0-rc.5
- Date
About
Lightweight TypeScript SQL toolkit. SQL-like query builder with full TypeScript inference. No runtime overhead, edge-friendly, and works with Postgres, MySQL, SQLite.
What it does
Drizzle pairs a schema-as-code TypeScript library with a separate command-line migration tool. You define tables as typed objects in code, then query them with method chains that mirror SQL syntax; joins return nested objects per table instead of one flattened row, so TypeScript can tell you which side of a join might be null. A companion CLI turns those schema definitions into SQL migration files, applies or pulls schema from a live database, and includes a browser-based data viewer. The library ships as a small core with dialect-specific column types layered on top for Postgres, MySQL, SQLite and others.
Why it's ranked here
The case for including it is in the type system, not the marketing copy. Nested join results that null-check per table, rather than one merged row you have to guess about, is a real engineering choice with tradeoffs, and the source code backs it up rather than just the README claiming it. Dialect support spans mainstream relational databases as well as several serverless drivers, handled through one configuration surface rather than separate adapters. That breadth, paired with a documented pattern for adding new column types, is what earns this a spot over a simpler query builder.
What's good
Joins are the standout: instead of flattening a join into one row with nullable fields you must check individually, results nest by table so a single null check covers every field from that side of the join. Adding a new column type follows a documented, consistent pattern: a builder class and a column class per dialect, so the extension surface is explicit rather than something you reverse-engineer from the core library. The migration CLI covers the full loop, generating SQL files, applying or pulling schema, and inspecting data, rather than stopping at code generation.
Tradeoffs
The migration CLI's configuration type is sprawling: separate credential shapes for AWS's data API, Cloudflare's SQLite service, Expo, PGlite, and a couple of others, each mutually exclusive with the rest, so picking the right combination for a given serverless target takes real reading. Custom column types tied to database extensions are explicitly flagged as not yet supported, only worked around with examples. Several old per-dialect command names survive only as hidden aliases that print a deprecation notice, a sign the CLI's interface has already changed shape once and may again.
How to use it well
This fits teams building a TypeScript backend who want the compiler to catch a mismatched join or a missing column before it hits production, especially across more than one deployment target such as an edge runtime and a traditional server. Define the schema once, use the CLI to generate and apply migrations as part of the normal deploy flow, and reach for the bundled data browser for quick manual checks instead of a separate admin tool. It is not a drop-in replacement for a full database administration console, and picking the right driver configuration for a serverless database still requires reading the specific dialect's setup docs closely.
Technical notes+
README.md and package.json describe a pnpm/Turborepo monorepo where the root package is private and drizzle-orm and drizzle-kit ship as separate publishable packages. drizzle-orm/src/index.ts re-exports the core modules: column and column-builder (the per-dialect extension pattern detailed in docs/custom-types.md), relations, sql, subquery, table, and view-common. drizzle-kit/src/index.ts defines the Config type consumed by the CLI, a discriminated union keyed on dialect (postgresql, mysql, sqlite, singlestore, gel) and driver (aws-data-api, d1-http, expo, pglite, durable-sqlite), each branch requiring a different dbCredentials shape. drizzle-kit/src/cli/index.ts wires that config to commands (generate, migrate, pull, push, studio, up, check, drop, exportRaw) plus a set of hidden legacy per-dialect aliases kept for backward compatibility. drizzle-kit/src/serializer/index.ts holds per-dialect serialize functions (serializeMySql, serializePg, serializeSQLite, serializeSingleStore) that turn schema files into snapshot objects for migration generation. docs/joins.md demonstrates the nested-select join typing; docs/table-introspect-api.md documents getTableConfig and getTableColumns for reading a defined table's metadata back out.
Observed
- Packaging
- Ships as two separate packages: a core ORM library and a companion CLI for migrations, run from one monorepo built with pnpm workspaces and Turborepo
- Packaging
- The root package is marked private; only the sub-packages are published
- CLI commands
- CLI commands cover the full migration lifecycle: generating SQL migration files, applying or pulling schema against a live database, and a bundled data-browsing tool
- Dialect support
- Configuration types support Postgres, MySQL, SQLite, and SingleStore dialects, plus dedicated drivers for AWS Data API, Cloudflare D1, Turso, Expo, and PGlite
- Query results
- Query builder returns join results as nested per-table objects rather than one flattened row, so nullability is checked once per joined table instead of per column
- Extensibility
- Adding a new column type follows a documented builder-class-plus-column-class pattern that is dialect-specific (separate implementations for Postgres, MySQL, and SQLite)
- CLI compatibility
- Several legacy per-dialect CLI command names are retained only as hidden aliases that print a deprecation message pointing to their replacement
- Limitations
- Custom column types tied to database extensions are documented as not yet supported, with only manual workaround examples provided
Read from README.md, package.json, drizzle-orm/src/index.ts, drizzle-kit/src/index.ts, drizzle-kit/src/cli/index.ts, drizzle-kit/src/serializer/index.ts, docs/table-introspect-api.md, docs/joins.md, docs/custom-types.md.
Tags
Tech Stack
Media

Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.