Drizzle

Drizzle

TypeScript ORM that feels like writing SQL

Features

  • SQL-like TypeScript query builder
  • Zero dependencies, lightweight bundle
  • Drizzle Kit for migrations and introspection
  • Works with any runtime (Node, Bun, Deno, edge)

Pros

  • SQL-first approach β€” no abstraction surprises
  • Tiny bundle size, perfect for serverless and edge
  • Supports relational queries and raw SQL seamlessly

Cons

  • Less mature ecosystem than Prisma
  • Documentation can be sparse for advanced patterns
  • Schema definition is more verbose than Prisma

Overview

Drizzle is a TypeScript ORM designed for developers who think in SQL. Instead of abstracting SQL away, Drizzle provides a type-safe TypeScript API that mirrors SQL syntax closely, so you always know what query will be generated. It has zero dependencies and an extremely small bundle size.

Drizzle supports PostgreSQL, MySQL, and SQLite (including Turso/libSQL and Cloudflare D1). Drizzle Kit provides schema migrations, database introspection, and Drizzle Studio for visual data browsing. Its edge-runtime compatibility makes it the go-to ORM for serverless deployments.

When to Use

Drizzle is the right choice when you want an ORM that stays close to SQL, when bundle size matters (serverless/edge), or when using SQLite-based platforms like Turso or D1. It’s increasingly the preferred ORM for modern TypeScript projects that value SQL transparency.

Getting Started

npm install drizzle-orm postgres
npm install -D drizzle-kit
import { pgTable, serial, text } from "drizzle-orm/pg-core";
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";

const users = pgTable("users", {
  id: serial("id").primaryKey(),
  name: text("name").notNull(),
  email: text("email").unique().notNull(),
});

const db = drizzle(postgres(process.env.DATABASE_URL));
const allUsers = await db.select().from(users);