Skip to content

Drizzle ORM

Medium — good to knowDatabase

ELI5 — The Vibe Check

Drizzle is a TypeScript ORM that feels like writing SQL, not fighting an abstraction layer. Unlike Prisma (which invents its own query language), Drizzle lets you write queries that look almost exactly like SQL but with full TypeScript type safety. If you know SQL, you already know Drizzle. It's the ORM for developers who actually like SQL and don't want a framework between them and their database.

Real Talk

Drizzle ORM is a lightweight, type-safe TypeScript ORM with a SQL-like query builder syntax. It supports PostgreSQL, MySQL, SQLite, and their serverless variants (Neon, PlanetScale, Turso). Key differentiators: zero runtime overhead (queries compile to raw SQL), schema declared in TypeScript, automatic migration generation, and a familiar SQL-like API. It's the fastest-growing ORM in the TypeScript ecosystem, favored for its minimalism and performance.

Show Me The Code

import { pgTable, text, integer, timestamp } from 'drizzle-orm/pg-core';
import { drizzle } from 'drizzle-orm/neon-http';

export const users = pgTable('users', {
  id: text('id').primaryKey(),
  name: text('name').notNull(),
  age: integer('age'),
  createdAt: timestamp('created_at').defaultNow()
});

const db = drizzle(process.env.DATABASE_URL);
const result = await db.select()
  .from(users)
  .where(eq(users.age, 25));

When You'll Hear This

"We switched from Prisma to Drizzle — the SQL-like syntax is so much cleaner." / "Drizzle's migration generation is automatic and painless."

Made with passive-aggressive love by manoga.digital. Powered by Claude.