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.
Related Reading
Guides and comparisons from the Greptile content library
The 7 Best AI Coding Tools for Complex Codebases
The best AI coding tools for complex codebases, ranked on accuracy, suggestion quality, and full-codebase context. See which ones you can actually trust.
Automated Code Review: How It Works & Best Tools [2026]
What automated code review is, how it differs from traditional and AI code review, the six types of code review automation tools, and why linters and SAST alone are no longer enough as agentic coding grows.
Flaky Tests: What Is a Flaky Test and How Do You Manage Them?
What flaky tests are, what causes them, how to detect them, and 12 ways to fix them. Plus why end-to-end tests are more prone to flakiness, and how seeing what actually happened during a run helps you tell a test problem from a code problem.
What Is Code Review? (And How to Keep It From Becoming the Bottleneck)
What code review is, how traditional, automated, and AI code review differ, and why review is now the bottleneck as AI writes more code. Plus how to pick a code review tool that catches real bugs.