Drizzle ORM: TypeScript ORM for SQL databases
Lightweight type-safe SQL query builder for TypeScript.
Learn more about Drizzle ORM
Drizzle ORM is a TypeScript-first object-relational mapping library designed for server-side JavaScript environments. It operates as a thin typed layer above SQL, allowing developers to define database schemas and construct queries using either relational or SQL-like syntax while maintaining type safety. The library ships at approximately 7.4kb minified and gzipped with no external dependencies, and supports multiple database engines including PostgreSQL, MySQL, SQLite, and various serverless database platforms. It runs across different JavaScript runtimes including Node.js, Bun, Deno, Cloudflare Workers, and edge computing environments.
Zero dependencies
The library includes no external dependencies and maintains a small bundle size of roughly 7.4kb minified and gzipped. Code is tree-shakeable, allowing unused portions to be removed during bundling.
Multi-runtime support
Drizzle runs in Node.js, Bun, Deno, Cloudflare Workers, Supabase functions, and browser environments without requiring serverless adapters or proxy layers. It works directly with both traditional and serverless database platforms.
Type-safe schema definition
Schemas are declared in TypeScript with full type inference for queries. The ORM supports both relational query builders and SQL-like query syntax while maintaining end-to-end type safety.
import { drizzle } from 'drizzle-orm/node-postgres';
import { users } from './schema';
import { eq } from 'drizzle-orm';
const db = drizzle(pool);
// Query users by email
const result = await db
.select()
.from(users)
.where(eq(users.email, 'john@example.com'));Improved drizzle-kit API for D1 connections.
- –drizzle-kit api improvements for D1 connections
Consolidated validator packages into drizzle-orm repo, moving drizzle-zod, drizzle-valibot, and other validators.
- –drizzle-zod -> drizzle-orm/zod
- –drizzle-valibot -> drizzle-orm/valibot
- –drizzle-typebox -> drizzle-orm/typebox-legacy (using @sinclair/typebox)
- –drizzle-typebox -> drizzle-orm/typebox (using typebox)
- –drizzle-arktype -> drizzle-orm/arktype
Improved migrator to apply all missing database changes and fixed various bugs in generate, pull commands, and cache invalidation.
- –Fixed generate and pull commands to display the SQL file instead of the folder path in the migration output message
- –Fixed cache not being invalidated after table updates
- –Fixed composite index with sort outputs a malformed SQL
- –Fixed db introspection generates broken schema.ts syntax
See how people are using Drizzle ORM
Top in Backend & APIs
Related Repositories
Discover similar tools and frameworks used by developers
ERPNext
Full-featured ERP system built on Frappe Framework.
Kong
Lua-based reverse proxy with pluggable architecture.
Beego
MVC framework for Go with integrated ORM and routing.
Evolution API
Node.js REST API for programmatic WhatsApp control.
chi
Composable Go HTTP router for web services with middleware chains and route groups.