AGENTS.md@packages/trueforge/src/db/postgres · git:20260816.f29d9ab · 2026-08-16 · sha256 a794d469be58278b

AGENTS.md@packages/trueforge/src/db/postgres git:20260816.f29d9abA

Immutable. This exact content is served forever at /api/v1/blob/a794d469be58278b.

- Temporal columns MUST use `timestamptz` (`timestamp with time zone`). Do not use `timestamp` without time zone.
- Application timestamps MUST be treated as UTC instants. Serialize with `Date.prototype.toISOString()` (always `...Z` with milliseconds).
- Do not run DB queries inside loops (N+1). Prefer a single batched query, a join, or an `IN`/`ANY` lookup over per-item round-trips.
- Postgres migrations MUST start `up`/`down` with `SET LOCAL lock_timeout = '5s'` so waiting DDL fails fast instead of blocking later queries (including `SELECT`s) behind it in the lock queue.