database · diff

git:20260903.a48472a to git:20261022.08bdce3

10 added, 7 removed. Audit A to A.

What this update changes in the checks

No check changed: every fixed check gives the same answer before and after this update.

A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.

---
name: database
description: Use when changing database schemas, migrations, database access, or database package structure. Keeps the Drizzle schema authoritative and migrations generated.
---
- # Database & migrations
+ # Database and migrations
- - Default to Drizzle when working with databases.
- - When runtime database access is Effect-based and targets PostgreSQL, use `@effect/sql-pg` as the Postgres adapter, and prefer the shared `@<repo>/db` helpers over app-local PgClient wiring.
- - Do not handwrite SQL migration files; generate them with Drizzle Kit from the schema source of truth.
- - Unless a database is intentionally app-private, keep its schema, migrations, config, and scripts in a dedicated package — `packages/db` for the primary database, one package per database if there are several.
- - The canonical justfile owns the local dev database container (`just dev-db-start`); never add a repo-local script for it.
- - Script migrations as `"db:migrate": "bun --env-file=.env.local drizzle-kit migrate"`; plain `bun run` does not load `.env.local`.
+ 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"`.