DEV Community

Alex Spinov
Alex Spinov

Posted on

Drizzle ORM Has a Free TypeScript ORM That Feels Like Writing SQL

Drizzle ORM gives you type-safe database queries that look like SQL. Zero runtime overhead, zero code generation.

The ORM Problem

Prisma: great DX, but requires code generation, has a query engine binary, and the query syntax looks nothing like SQL.

TypeORM: decorator-heavy, inconsistent types, maintenance concerns.

Drizzle: your queries ARE SQL — just with TypeScript types.

What You Get for Free

SQL-like query builder:

const users = await db
  .select()
  .from(usersTable)
  .where(eq(usersTable.age, 25))
  .leftJoin(postsTable, eq(usersTable.id, postsTable.authorId));
Enter fullscreen mode Exit fullscreen mode

If you know SQL, you know Drizzle.

Zero code generation — no prisma generate, no build step
Zero runtime dependencies — Drizzle is a thin TypeScript layer
All major databases: PostgreSQL, MySQL, SQLite, Turso, Neon, PlanetScale
Drizzle Kit — migrations, introspection, studio (database browser)

Quick Start

npm i drizzle-orm postgres
npm i -D drizzle-kit
Enter fullscreen mode Exit fullscreen mode

Define your schema:

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

export const users = pgTable('users', {
  id: serial('id').primaryKey(),
  name: text('name').notNull(),
  age: integer('age'),
});
Enter fullscreen mode Exit fullscreen mode

Generate and run migration:

npx drizzle-kit generate
npx drizzle-kit migrate
Enter fullscreen mode Exit fullscreen mode

Why Developers Are Switching

  1. No black box — you see exactly what SQL runs. db.select()... maps 1:1 to SQL
  2. Serverless-friendly — no connection pooling binary, no cold start penalty
  3. Type inference — query results are fully typed based on your schema
  4. Relational queries — Drizzle also has a Prisma-like relational API if you prefer:
const result = await db.query.users.findMany({
  with: { posts: true },
  where: eq(users.age, 25),
});
Enter fullscreen mode Exit fullscreen mode

Drizzle Studio

npx drizzle-kit studio
Enter fullscreen mode Exit fullscreen mode

Opens a local web UI to browse your database, run queries, and edit data. Free, no account required.

If you think in SQL but want TypeScript safety — Drizzle is exactly what you've been looking for.


Need web scraping or data extraction? Check out my tools on Apify — get structured data from any website in minutes.

Custom solution? Email spinov001@gmail.com — quote in 2 hours.

Top comments (0)