data-layer-handbook

Installation
SKILL.md

Instructions

When to Use

  • Use when choosing Prisma vs Drizzle vs SQL for Next.
  • Prefer database-schema-agent after ORM choice for Prisma schema work.
  • Prefer auth-handbook if the question is sessions, not storage.

Pick a data layer for Next.js when Prisma is not assumed.

  1. Prisma: best when team wants migrations, studio, rich relation API, and mostly Node runtime. Use database-schema-agent for schema design and audits.
  2. Drizzle: strong when you want SQL-first, lighter runtime, edge-friendly drivers with explicit SQL; migrations via drizzle-kit - verify driver supports your DB (Postgres, SQLite, etc.).
  3. Raw SQL / Kysely: acceptable for reporting or tight performance paths - isolate in repository modules; parameterize queries (no string concat for user input).
  4. Serverless pooling: avoid unbounded new Client() per request; use connection pooler (PgBouncer, Neon, Supavisor, etc.) - name pattern, not vendor mandate.
  5. Edge: Prisma often needs Data Proxy or separate Node path; Drizzle edge drivers still have SQL dialect limits - align with edge-runtime-handbook.
  6. Transactions: boundary at use-case level; retry idempotency for user-facing writes documented in api-handbook.

Outcomes

Installs
4
First Seen
May 30, 2026
data-layer-handbook — bh611627/skillcodex