database · git:20261022.08bdce3 · 2026-10-22 · sha256 d6bf0104437f818c

database git:20261022.08bdce3A

Immutable. This exact content never changes and is served at /api/v1/blob/d6bf0104437f818c.

No tool to install first
claude plugin marketplace add https://markdownregistry.com/mp/a/art_2csflbj57x3zpib3/d6bf0104437f818c0dd4c4d7600e67dddfa12dd7af8439b035339ea6bdfe68b3.json

Then /plugin install database@markdownregistry-2csflbj57x3zpib3 in Claude Code. It installs this exact version, the one graded A here, pinned to the commit it was graded at, and leaves it there.

---
name: database
description: Use when changing database schemas, migrations, database access, or database package structure. Keeps the Drizzle schema authoritative and migrations generated.
---

# Database and migrations

Databases default to Drizzle, and the Drizzle schema is the source of truth. Generate migrations from it with `drizzle-kit generate`, and use `drizzle-kit generate --custom` for SQL the schema can't express.

Unless a database is private to one app, its schema, migrations, Drizzle config, and scripts live in a dedicated package: `packages/db` for the primary database, and one package per additional database.

Effect code accesses PostgreSQL through `@effect/sql-pg`, using the connection helpers from the project's `@<project>/db` package rather than its own `PgClient`.

The canonical justfile owns the local development database (`just dev-db-start`). Don't add a project script or compose file for it.

`bun run` doesn't load `.env.local`, so scripts that need `DATABASE_URL` load it explicitly, as in `"db:migrate": "bun --env-file=.env.local drizzle-kit migrate"`.