What problem does it solve?
It standardizes how your application defines database schemas, writes safe queries and mutations, and delivers consistent migrations so your Drizzle + Neon Postgres data layer stays reliable as it evolves.
Core Features & Use Cases
- Schema-first development with derived types: enforce a single source of truth in
lib/db/schema/*.ts and generate $inferSelect/$inferInsert types instead of duplicating interfaces.
- Operational safety patterns: guarantee audit traceability via
...auditFields, prefer soft delete with deletedAt, and keep timestamps in UTC with withTimezone: true.
- Correctness and performance by default: encourage transactions for multi-step writes and avoid N+1 queries using joins or Drizzle
with relations.
Use case example: creating a new domain entity (e.g., an order) with related rows (e.g., order tags) while recording audit fields, ensuring atomicity through db.transaction(), and generating a migration safely from schema changes.
Quick Start
Update your entity schema in lib/db/schema/*.ts, then generate and apply the migration using the Drizzle commands recommended by this skill while following the audit fields, timezone, transaction, and anti-N+1 rules.