drizzle-orm

Standardize TypeScript database schemas, relations, and drizzle-kit migrations for PostgreSQL.

Updated May 23, 2026
One-click install
npx skills add https://github.com/devturco/thiago-dev-template --skill drizzle-orm-devturco
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-orm
Source: https://github.com/devturco/thiago-dev-template/tree/main/.claude/skills/drizzle-orm
Command: npx skills add https://github.com/devturco/thiago-dev-template --skill drizzle-orm-devturco

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Drizzle ORM guidelines reduce mistakes in TypeScript database modeling by enforcing schema-as-code, compile-time type safety, and efficient query patterns for relational data.

Core Features & Use Cases

  • Schema-as-code with type safety: Define tables, relations, and inferred insert/select models directly in TypeScript to catch issues before runtime.
  • Relational modeling & relations queries: Model foreign keys and use Drizzle relations patterns to avoid inefficient data access patterns like N+1 queries.
  • Migrations and performance hygiene: Generate and run migrations with drizzle-kit while applying indexing and selective column fetching to keep queries fast.

Quick Start

Ask your AI to draft a Drizzle schema for your Postgres tables, including indexes, relations, and the migration workflow to safely ship the changes.

Frequently Asked Questions about drizzle-orm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define type-safe PostgreSQL schemas in TypeScript?

Type-safe PostgreSQL schemas are defined by declaring tables, relations, and inferred insert/select models directly in TypeScript as schema-as-code, catching database issues at compile time before runtime.

What is the best way to prevent N+1 queries when modeling relations in Drizzle ORM?

Prevent N+1 queries in Drizzle ORM by modeling foreign keys and applying relational data patterns to optimize data access, avoiding inefficient query execution during relational reads.

How do I generate and run database migrations with drizzle-kit?

Generate and run database migrations with drizzle-kit by applying deterministic migration generation and execution workflows, safely shipping schema changes to PostgreSQL environments.

Does Drizzle ORM work with Bun and Node environments for PostgreSQL?

Drizzle ORM supports building and refactoring relational data models for PostgreSQL in both Bun and Node environments, standardizing schema design and CRUD operations across these runtimes.

How do I optimize PostgreSQL query performance with schema indexing?

Optimize PostgreSQL query performance by applying indexing practices and selective column fetching within your schema definitions, keeping database queries fast and efficient during data retrieval.