drizzle-patterns

Standardize PostgreSQL schema, relations, and queries with Drizzle ORM.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/qazuor/claude-code-knowledge --skill drizzle-patterns-qazuor
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: drizzle-patterns
Source: https://github.com/qazuor/claude-code-knowledge/tree/main/skills/drizzle-patterns
Command: npx skills add https://github.com/qazuor/claude-code-knowledge --skill drizzle-patterns-qazuor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Drizzle ORM patterns help developers build reliable PostgreSQL data layers by standardizing schema, relations, and query patterns, enabling consistent, type-safe data access.

Core Features & Use Cases

  • Schema Definition and Tables with Indexes and Constraints
  • Relations and Type Inference
  • CRUD Queries, Pagination, and Transactions
  • Migrations and Testing Strategies

Quick Start

Install drizzle-orm and drizzle-kit in a TypeScript project, define schemas with pgTable, implement relations, and start building type-safe queries following the patterns shown in this skill.

Frequently Asked Questions about drizzle-patterns

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

FAQPage Schema
How do I define relations and infer types in a Drizzle ORM PostgreSQL schema?▼

Define Drizzle ORM PostgreSQL schema relations using pgTable and the relations function, then leverage $inferSelect to automatically infer TypeScript types for type-safe data access.

What is the best way to manage PostgreSQL database migrations in a TypeScript project?▼

The best way to manage PostgreSQL database migrations in a TypeScript project is using drizzle-kit, which integrates with Drizzle ORM schema definitions to generate and apply migration files systematically.

How do I build type-safe CRUD queries and pagination with Drizzle ORM?▼

Build type-safe CRUD queries and pagination with Drizzle ORM by applying its query builder constructs to your pgTable schemas, ensuring consistent data retrieval while maintaining strict TypeScript type inference.

Do I need drizzle-kit to standardize schema definitions and testing strategies?▼

Yes, you need drizzle-kit to manage migrations for standardizing schema definitions, while Drizzle ORM constructs enable consistent type-safe data access and structured testing strategies in TypeScript projects.

How does Drizzle ORM handle transactions for reliable PostgreSQL data layers?▼

Drizzle ORM handles transactions by providing structured query patterns that wrap multiple operations, ensuring reliable PostgreSQL data layers through consistent, type-safe execution within TypeScript projects.