DR

Drizzle ORM

SQL-like TypeScript ORM

Details

Language / Topic
javascriptJavaScript
Category
Libraries

Rules

balanced
- Define schema in TypeScript with Drizzle's table builders. Infer types with `typeof table.$inferSelect`.
- Use the query builder API for type-safe queries. Use `drizzle-kit` for migrations.
- Use `drizzle-kit push` for rapid prototyping and `drizzle-kit generate` + `migrate` for production schema changes.
- Use relational queries (`.query.table.findMany({ with: { ... } })`) for eager loading related data.
- Use `drizzle-kit push` for rapid development, `drizzle-kit generate` + `migrate` for production.
- Use `.where()` with Drizzle operators (`eq`, `and`, `or`, `like`, `inArray`) for type-safe filtering.
- Keep schema definitions close to the domain — one schema file per module or feature.