drizzle-orm

Define TypeScript schemas and build type-safe SQL queries with Drizzle ORM.

6|1|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill drizzle-orm-repairyourtech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-orm
Source: https://github.com/RepairYourTech/cfsa-antigravity/tree/main/.agent/skill-library/stack/orm/drizzle-orm
Command: npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill drizzle-orm-repairyourtech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies and secures database interactions by providing a type-safe way to define schemas, build queries, and manage migrations, preventing common errors and improving developer productivity.

Core Features & Use Cases

  • Schema Definition: Define database schemas using TypeScript for strong typing.
  • Query Building: Construct type-safe SQL queries using a fluent API.
  • Relational Queries: Easily fetch related data with type safety.
  • Migrations: Manage database schema evolution with drizzle-kit.
  • Zod Integration: Validate data with Zod schemas derived from Drizzle tables.
  • Use Case: When building a new feature that requires user authentication and data storage, use this Skill to define the users and sessions tables, write type-safe queries to create, retrieve, and update user data, and generate migration files to apply these changes to your database.

Quick Start

Use the drizzle-orm skill to define a new 'products' table with 'id', 'name', and 'price' columns.

Frequently Asked Questions about drizzle-orm

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

FAQPage Schema
How do I build type-safe SQL queries in a Node.js application?

You can build type-safe SQL queries by defining database schemas using TypeScript and constructing statements with a fluent API. This method prevents common errors during database interactions by ensuring query structures match your defined types.

How do I manage database migrations with Drizzle ORM?

You manage database schema evolution using drizzle-kit to generate and apply migration files. This process allows you to track changes to your database structure over time while maintaining type safety across your Node.js application.

Can I validate database data using Zod with Drizzle ORM?

Yes, you can validate data by integrating Zod schemas derived directly from Drizzle tables. This ensures your application data conforms to specified validation rules before executing type-safe insert or update operations.

What is the best way to fetch related data with type safety in TypeScript?

The best way to fetch related data is by using relational queries provided by the ORM. This allows you to easily retrieve nested related records while maintaining strict TypeScript type safety across the queried results.

Does Drizzle ORM support raw SQL execution and transactions?

Yes, the ORM supports both raw SQL execution and transactions. This allows you to execute complex database operations directly while preserving type safety and managing multi-step database changes safely.

How do I define a database schema in TypeScript for type-safe access?

You define a database schema by declaring tables and columns using TypeScript objects. This schema definition provides the strong typing foundation required for constructing type-safe select, insert, update, and delete queries.