When to use
Use this skill for:
- schema changes
- migrations
- SQL review
- index strategy
- query performance
- normalization and data modeling
- PostgreSQL, SQLite, Supabase, Neon, Turso, pgvector
Core operating rules
- Start from entities, relationships, query patterns, and scale.
- Design indexes from actual access patterns.
- Use constraints to protect integrity.
- Measure query performance before optimizing.
- Prefer reversible, low-risk migrations.
Decision guidance
- Full relational features: PostgreSQL/Neon.
- Edge/local simplicity: SQLite/Turso.
- Vector/AI retrieval: PostgreSQL + pgvector.
- Edge ORM: Drizzle.
- Schema-first DX: Prisma.
Execution workflow
- Restate entity and query requirements.
- Propose schema or migration approach.
- Define keys, constraints, and indexes.
- Review common query paths.
- Provide rollback or safety plan.
Mandatory checks
- Primary and foreign keys are defined appropriately.
- Constraints reflect business rules.
- No
SELECT *in performance-sensitive code. - Indexes map to real queries.
- Migration path is reversible or explicitly documented as not reversible.
- Query plan review is included when optimizing.