drizzle-orm

Generate type-safe database queries and migrations for PostgreSQL and SQLite.

1|Updated Nov 26, 2014
One-click install
npx skills add https://github.com/tianhuil/dotfiles --skill drizzle-orm-tianhuil
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-orm
Source: https://github.com/tianhuil/dotfiles/tree/main/home/.config/opencode/skills/drizzle-orm
Command: npx skills add https://github.com/tianhuil/dotfiles --skill drizzle-orm-tianhuil

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Type-safe, boilerplate-free database access for TypeScript applications, eliminating repetitive code and unsafe SQL strings.

Core Features & Use Cases

  • Type-safe schema and queries: write queries against a typed schema with compile-time checks.
  • Migrations and tooling: manage migrations with drizzle-kit and generated schemas.
  • Cross-database support: works with PostgreSQL and SQLite via a consistent API.

Quick Start

Initialize drizzle-kit, configure drizzle.config.ts, and connect to your database to start building a type-safe data layer.

Frequently Asked Questions about drizzle-orm

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

FAQPage Schema
How do I enforce type-safe database queries in a TypeScript project?

Type-safe database queries in TypeScript are enforced by defining a typed schema that enables compile-time checks, eliminating unsafe SQL strings and repetitive boilerplate code. This ensures invalid column references or data types are caught during development rather than at runtime.

What is the best way to manage migrations in a TypeScript ORM?

Migrations in a TypeScript ORM are best managed using drizzle-kit to generate schemas and apply changes. By configuring drizzle.config.ts, you can track and execute database migrations automatically, ensuring your schema stays synchronized with your codebase.

Does this type-safe ORM work with both PostgreSQL and SQLite?

Yes, this type-safe ORM works with both PostgreSQL and SQLite via a consistent, driver-agnostic API. You can execute type-safe queries and manage migrations across different database engines without changing your core data access logic.

Do I need drizzle-kit to start building a type-safe data layer?

Yes, you need drizzle-kit and a defined schema within a TypeScript environment to start building a type-safe data layer. Initializing drizzle-kit and configuring drizzle.config.ts provides the tooling to generate schemas and manage migrations.

Why should I use a TypeScript ORM instead of raw SQL strings for database access?

You should use a TypeScript ORM instead of raw SQL strings to eliminate boilerplate and enforce type-safe database access. It provides compile-time checks against a typed schema, preventing runtime errors caused by malformed queries or data type mismatches.