Files
sim/packages/db/.env.example
T
Waleed 284edf0b85 improvement(db): opt-in read-replica client + migration runner hardening (#4955)
* improvement(db): add opt-in read-replica client and harden migration runner

* fix(db): detect wrapped lock-timeout errors, jittered retries, direct migration DSN support

* fix(db): audit fixes — unparameterized SET, primary reads for authz scoping, shared error helper

* fix(db): pin migration session — disable max_lifetime recycling, guard backend pid across retries

* fix(db): gate pid session guard to direct migration connections (pooler pids legitimately vary)

* improvement(billing): route display-only usage aggregations to the read replica via executor threading

* chore(db): drop call-site justification comments

* chore(db): tighten doc comments

* ci(migrations): map optional direct-connection DSN secrets

* fix(data-drains): add stability window to time cursors so late-visible rows are never skipped

* fix(billing): resolve pagination cursor on primary; replica for member ledger display

* fix(billing): usage-limits returns cost and limit from one computation
2026-06-10 18:33:58 -07:00

12 lines
588 B
Bash

# Database connection used by @sim/db scripts (drizzle-kit generate,
# db:migrate, register-sso-provider, etc.). Must match DATABASE_URL in
# apps/sim/.env and apps/realtime/.env. Migrations always run against the
# primary — never set a replica URL here.
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/simstudio"
# Direct (non-pooled) DSN for db:migrate. Required when DATABASE_URL points at
# a transaction-pooling PgBouncer: session advisory locks and session SETs are
# unsupported through transaction pooling. Falls back to DATABASE_URL.
# MIGRATION_DATABASE_URL=""