Drizzle ORM

A lightweight TypeScript ORM with SQL-like and relational query APIs across major SQL databases.

my take

A thin, SQL-close TypeScript ORM with great types and a tiny runtime. My pick when I want to stay near SQL and have agents generate correct queries.

Drizzle is a TypeScript ORM that stays deliberately close to SQL. You define your schema in TypeScript, get fully-typed queries, and run lightweight migrations — without a heavy runtime sitting between you and the database. It works with Postgres, MySQL and SQLite, including the serverless drivers.

Start with this

ts
import { drizzle } from 'drizzle-orm/node-postgres';
import { pgTable, serial, text } from 'drizzle-orm/pg-core';
import { eq } from 'drizzle-orm';

export const tools = pgTable('tools', {
  id: serial('id').primaryKey(),
  name: text('name').notNull(),
  price: text('price').notNull(),
});

const db = drizzle(process.env.DATABASE_URL!);

// fully typed, SQL-shaped queries
const free = await db.select().from(tools).where(eq(tools.price, 'free'));

The take, for AI builders

For AI builders, Drizzle's thin, SQL-shaped API is a gift: agents generate correct queries because the code reads like the SQL it becomes, and the types catch mistakes before they run. Reach for it when you want to understand your data layer rather than hand it to a black box. If you'd rather have more conventions and a visual studio, Prisma is the heavier, friendlier option.

When to reach for it

✓ Good fit

  • You want type-safe queries that stay close to real SQL
  • Serverless and edge runtimes where a light footprint matters
  • AI-assisted projects where readable, predictable query code helps

✕ Not for

  • You prefer a batteries-included ORM with more conventions (use Prisma)
  • You don't want to think about SQL at all

Alternatives

  • More conventions, a visual studio and a bigger ecosystem, at the cost of a heavier runtime.

  • If you want the database, auth and APIs together rather than just an ORM.

Visit Drizzle ORM

Related in Backend & data

Backend & data

Algolia

A hosted search API delivering fast, typo-tolerant, relevant search-as-you-type.

Freemium
  • search
  • api
  • hosted
take

Search that feels instant and forgives typos, as a hosted API — the gold standard for site and app search. Brilliant DX; costs climb with scale, so watch the meter.

Visit ↗
Backend & data

Appwrite

An open-source backend platform with auth, databases, storage, functions and realtime, self-hosted or cloud.

Freemium
  • baas
  • open-source
  • self-hostable
take

An open-source Firebase alternative with auth, databases, storage, functions and realtime. The pick when you want Firebase's breadth without the lock-in.

Visit ↗
Backend & data

Auth0

An identity-as-a-service platform (an Okta company) with authentication, SSO and MFA for applications.

Freemium
  • auth
  • identity
  • enterprise
take

The enterprise identity standard — social, SSO, MFA, the lot. Rock-solid and feature-deep; pricing climbs steeply once you need enterprise connections.

Visit ↗