drizzle-best-practices
Installation
SKILL.md
Drizzle ORM Best Practices (PostgreSQL)
Comprehensive best practices guide for Drizzle ORM with PostgreSQL. Contains guidance across 8 categories, prioritized by impact to help you write correct, performant, and maintainable database code.
When to Apply
Reference these guidelines when:
- Defining table schemas with
pgTable - Writing select, insert, update, or delete queries
- Setting up relations between tables using
defineRelationsor the legacyrelationsAPI - Configuring
drizzle-kitfor migrations (generate,push,pull) - Inferring TypeScript types from your schema
- Choosing between the SQL-like API and the relational query API
- Optimizing query performance with prepared statements or batch operations
- Integrating Drizzle with serverless Postgres providers (Neon, Supabase, etc.)