drizzle-orm

Define PostgreSQL schemas and run type-safe queries with Drizzle ORM.

885|108|Updated Apr 30, 2025
One-click install
npx skills add https://github.com/legions-developer/invoicely --skill drizzle-orm-legions-developer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-orm
Source: https://github.com/legions-developer/invoicely/tree/main/.agents/skills/drizzle
Command: npx skills add https://github.com/legions-developer/invoicely --skill drizzle-orm-legions-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Drizzle ORM eliminates the mismatch between TypeScript types and database schemas by providing compile-time, SQL-like query building that stays aligned with your schema definitions.

Core Features & Use Cases

  • Type-safe schema + inference: Define tables and columns in TypeScript and get strongly typed insert/select models.
  • SQL-like query builder with guardrails: Compose filters, joins, aggregation, pagination, and transactions using an API that maps directly to SQL concepts.
  • Practical migrations and performance patterns: Use Drizzle Kit for generating/migrating schema changes and follow best practices for indexing, limiting, and optimizing queries in production.

Use case: You are building an invoicing backend and need to store customers and invoices with reliable migrations, safe query composition (including joins and filters), and consistent TypeScript types across your API routes and server actions.

Quick Start

Use the drizzle-orm skill to implement a pgTable schema and run your first typed insert, select, where-filter, update, and delete for a PostgreSQL database connection.

Frequently Asked Questions about drizzle-orm

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

FAQPage Schema
How do I keep TypeScript types consistent with SQL database schemas?

To keep TypeScript types consistent with SQL schemas, define tables using Drizzle ORM to get compile-time type safety and strongly typed insert/select models with zero runtime overhead.

What is the best way to generate database migrations for a TypeScript backend?

The best way to generate database migrations for a TypeScript backend is using Drizzle Kit to safely evolve schemas, applying migration workflows that keep your application models aligned with PostgreSQL schema changes.

Does Drizzle ORM work with serverless and edge-compatible environments?

Yes, Drizzle ORM works with serverless and edge-compatible environments, targeting schema definition, migrations, and everyday CRUD query workflows specifically for TypeScript backends running in those contexts.

How do I execute type-safe SQL queries with joins and filters in TypeScript?

You execute type-safe SQL queries by composing filters, joins, aggregation, pagination, and transactions via a supported driver like node-postgres, using an API that maps directly to SQL concepts with built-in guardrails.

How do I define PostgreSQL tables and run typed CRUD operations?

You define PostgreSQL tables using drizzle-orm/pg-core, then execute your first typed insert, select, where-filter, update, and delete operations through a supported database connection for reliable query composition.