skillfed

drizzle

Drizzle is a TypeScript-first ORM built for compile-time type safety and edge-runtime performance. Define schemas with SQL-like syntax, execute queries with full type inference, and manage one-to-many and many-to-many relations without runtime dependencies.

Drizzle ORM enables type-safe database queries in TypeScript with zero runtime overhead and SQL-like syntax.

AI-generated summary based on this skill's SKILL.md

62 18 MIT updated by bobmatnyc

Install

bobmatnyc/claude-mpm-skills/drizzle · repository language: Python

CLI (skillfed)coming soon
git clone https://github.com/bobmatnyc/claude-mpm-skills
cp -r claude-mpm-skills/toolchains/typescript/data/drizzle ~/.claude/skills/drizzle

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is Drizzle ORM and how do I set it up for TypeScript?

Drizzle is a TypeScript-first ORM built for compile-time type safety and edge-runtime performance. To set up Drizzle, install the package via npm, configure your database connection (PostgreSQL, MySQL, SQLite, etc.), define your schema using Drizzle's SQL-like syntax, and start executing type-safe queries. Drizzle provides zero runtime overhead, meaning your compiled code runs efficiently without extra dependencies.

How does Drizzle compare to Prisma in terms of performance?

Drizzle vs Prisma: Drizzle is designed for zero runtime overhead and edge-runtime compatibility, making it lighter and faster for serverless environments. Prisma offers a more abstracted API but adds runtime dependencies. Drizzle excels in compile-time type safety and query performance, while Prisma provides a more opinionated developer experience. Choose Drizzle for performance-critical applications and edge deployments.

How do I define database schemas and relations using Drizzle?

Drizzle schema definition uses SQL-like syntax to declare tables and columns with full type inference. Define one-to-many and many-to-many relations using Drizzle's relation helpers. Your schema is type-safe at compile time, so TypeScript catches errors before runtime. Use Drizzle Kit CLI to generate and manage migrations automatically from your schema definitions.

What is a zero runtime overhead ORM and why does Drizzle offer it?

A zero runtime overhead ORM compiles to efficient SQL without adding extra dependencies or runtime layers. Drizzle achieves this through compile-time type safety and direct SQL generation. This approach makes Drizzle ideal for edge runtimes, serverless functions, and performance-sensitive applications where every millisecond matters.

How do I optimize database queries and handle transactions in Drizzle?

Drizzle supports query optimization through type-safe query builders and transaction handling. Write efficient queries using Drizzle's fluent API, leverage type inference to catch mistakes early, and wrap multiple operations in transactions for data consistency. Drizzle's compile-time optimizations ensure your queries run fast without runtime overhead.

Can I use Drizzle with Next.js and serverless environments?

Yes, Drizzle integrates seamlessly with Next.js and serverless platforms. Its edge-runtime compatibility and zero runtime overhead make it perfect for Next.js API routes and edge functions. Drizzle works with PostgreSQL, MySQL, and SQLite, supporting both traditional and serverless database setups.

SKILL.md

rendered from the published skill — quoted content, verbatim

Drizzle ORM

Modern TypeScript-first ORM with zero dependencies, compile-time type safety, and SQL-like syntax. Optimized for edge runtimes and serverless environments.

Quick Start

Installation
# Core ORM
npm install drizzle-orm

# Database driver (choose one)
npm install pg            # PostgreSQL
npm install mysql2        # MySQL
npm install better-sqlite3 # SQLite

# Drizzle Kit (migrations)
npm install -D drizzle-kit
Basic Setup

```typescript // db/schema.ts import { pgTable, serial, text, timestamp } from 'drizzle-orm/pg-core';

export const users = pgTable('users', { id:

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 6 files
toolchains/typescript/data/drizzle/SKILL.md
toolchains/typescript/data/drizzle/metadata.json
toolchains/typescript/data/drizzle/references/advanced-schemas.md
toolchains/typescript/data/drizzle/references/performance.md
toolchains/typescript/data/drizzle/references/query-patterns.md
toolchains/typescript/data/drizzle/references/vs-prisma.md

Related skills

Tags

type-safe-queries edge-runtime-ready zero-dependencies sql-like-syntax schema-inference compile-time-safety serverless-optimized lightweight-orm migration-tooling relational-mapping