What problem does it solve?
Drizzle Schema provides a clear, type-safe way to declare database tables, columns, constraints, indexes, and enums in TypeScript so schemas stay synchronized with application types and can be reliably turned into SQL migrations.
Core Features & Use Cases
- Dialect support: Author schemas for PostgreSQL, MySQL, and SQLite using dialect-specific table functions and column types.
- Type safety and inference: Columns and enums map to TypeScript types and provide inferred insert and select shapes for safer queries.
- Migrations and tooling: Exported schema modules are consumable by drizzle-kit to automatically generate SQL migrations.
- Use Case: Define users, posts, tags, relations, and indexes in source-controlled TypeScript, then generate migration SQL for CI-driven deployments.
Quick Start
Create a schema file exporting tables for your chosen dialect and run npx drizzle-kit generate to produce migration SQL.