Drizzle ORM

Build type-safe SQL queries and migrations for PostgreSQL, MySQL, and SQLite in TypeScript.

88|11|Updated Apr 28, 2020
One-click install
npx skills add https://github.com/blockmatic/basilic --skill drizzle-orm-blockmatic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Drizzle ORM
Source: https://github.com/blockmatic/basilic/tree/main/.cursor/skills/drizzle-orm-v0
Command: npx skills add https://github.com/blockmatic/basilic --skill drizzle-orm-blockmatic

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Drizzle ORM fills the gap for type-safe SQL query construction and migrations in TypeScript applications, enabling safer and more predictable data access.

Core Features & Use Cases

  • Type-safe table builders (pgTable, mysqlTable, sqliteTable) with generated types and relations.
  • Migrations via drizzle-kit and relational query support, including transactions and prepared statements.
  • Seamless integration across PostgreSQL, MySQL, and SQLite for robust data models and scalable apps.

Quick Start

Define your schema with drizzle-orm table builders, generate migrations with drizzle-kit, and start writing type-safe queries in your TypeScript project.

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 TypeScript application?

You can build type-safe SQL queries in a TypeScript application by defining schemas with Drizzle ORM table builders and utilizing its relational query API to ensure predictable data access.

Does Drizzle ORM support both PostgreSQL and SQLite databases?

Yes, Drizzle ORM supports PostgreSQL, MySQL, and SQLite, providing dedicated table builders like pgTable and sqliteTable to define robust data models across multiple database platforms.

How do I manage database migrations with drizzle-kit in TypeScript?

You manage database migrations in TypeScript by defining your schema with table builders and generating migration files using drizzle-kit to track and apply schema changes.

Can I use transactions and prepared statements with Drizzle ORM?

Yes, Drizzle ORM supports transactions and prepared statements, allowing you to execute complex relational queries safely across PostgreSQL, MySQL, and SQLite environments.

What is the best way to generate insert and select types for TypeScript database schemas?

The best way to generate types is by using Drizzle ORM's $inferSelect and $inferInsert utilities, which automatically create TypeScript types directly from your defined database schema.