PACKAGE · ORM & DATABASE

drizzle-orm

Drizzle ORM package for SQL databases

WEEKLY DOWNLOADS 5.5M
STARS 34.7K
FORKS 1.4K
OPEN ISSUES 1.8K
GZIP SIZE 8.6 kB
UNPACKED SIZE 10.4 MB
DEPENDENCIES 0
LAST UPDATED 3mo ago
DOWNLOAD TRENDS

drizzle-orm downloads — last 12 months

Download trends for drizzle-orm1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.010.1M20.3M30.4M40.6MJun 2025SepDecMarMay 2026
drizzle-orm
ABOUT DRIZZLE-ORM

Drizzle ORM is a TypeScript-first SQL ORM designed to provide a type-safe database access layer for Node.js and other JavaScript runtimes. It addresses the common challenge of bridging the gap between application code and relational databases, offering a compile-time guarantee against common SQL-related errors.

The core philosophy of Drizzle ORM is to provide a developer experience that feels native to TypeScript, with minimal abstraction and a focus on developer productivity without sacrificing performance. It aims to be intuitive for developers familiar with SQL and TypeScript, offering a familiar yet type-enhanced way to interact with databases.

Drizzle ORM achieves type safety through its unique schema definition API, which allows you to define your database schema in TypeScript. This schema definition is then used to generate type-safe query builders, such as `select`, `insert`, `update`, and `delete`. It also introduces concepts like `pg`, `mysql`, and `sqlite` for database interactions, and its query builder offers a declarative way to construct SQL queries.

This ORM integrates seamlessly with various JavaScript and TypeScript environments, including Node.js runtimes, Bun.js, and serverless functions. It has a flexible integration strategy, allowing it to be used with popular frameworks and runtime environments without imposing significant constraints. Its companion package, `drizzle-kit`, provides tools for schema migration and database interaction management.

With a bundle size of only 8.6 kB (gzip), Drizzle ORM is highly performant and has a minimal impact on application load times. Its robust tooling and strong community support, evidenced by 33.5K GitHub stars, indicate a mature and actively developed project, though the 1.6K open issues suggest areas for ongoing development and community engagement.

While Drizzle ORM excels in type safety and performance, developers should be aware that it is primarily a SQL query builder. It does not include features like automatic data mapping to complex object structures found in some other ORMs, requiring developers to manage data transformations more explicitly. Its focus on SQL means that developers must have a solid understanding of SQL concepts to leverage it effectively.

WHEN TO USE
  • When building applications requiring strict compile-time type safety for database operations across TypeScript projects.
  • When leveraging Drizzle ORM's schema definition to generate type-safe query builders for `select`, `insert`, `update`, and `delete` statements.
  • When integrating with Node.js, Bun.js, or serverless environments that benefit from a lightweight ORM.
  • When needing to define database schemas in TypeScript and manage migrations using the `drizzle-kit` tool.
  • When working with multiple SQL database dialects like PostgreSQL, MySQL, or SQLite and requiring a unified, type-safe API.
  • When a minimal bundle size is critical for client-side or edge functions.
WHEN NOT TO USE
  • If your primary need is an ORM that abstracts away raw SQL entirely and provides automatic complex object-relational mapping, a different approach might be more suitable.
  • When you are working in an environment that strictly forbids or does not support TypeScript.
  • If you only need basic data storage and retrieval without complex query logic, consider simpler solutions like direct SQL drivers or minimal query builders.
  • When your team is not comfortable with SQL concepts or TypeScript, as Drizzle ORM's effectiveness is tied to proficiency in both.
  • For projects that require features like automatic schema generation from existing databases without custom tooling or significant setup.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 6
drizzle-orm vs mongoose ★ 27.5K · 2.8M/wk drizzle-orm vs sequelize ★ 30.4K · 1.4M/wk drizzle-orm vs typeorm ★ 36.5K · 2.1M/wk drizzle-orm vs kysely ★ 13.9K · 3.5M/wk drizzle-orm vs prisma ★ 46.2K · 6.5M/wk drizzle-orm vs knex ★ 20.3K · 2.0M/wk