Make database connection pool size configurable #2

Closed
opened 2026-06-02 04:26:42 +00:00 by logaritmisk · 0 comments
Owner

Db::connect hardcodes PgPoolOptions::new().max_connections(5) (crates/db/src/lib.rs).

Pool sizing is operationally significant for the per-org-deployment model (total connections = sum of all org pools against the shared Postgres; see docs/specs/2026-06-02-mvp-architecture.md §3/§4). Promote it to configuration so it can be tuned per environment without an API change.

  • Accept pool size via config (e.g. a DbConfig { url, max_connections } or a Config field with a sensible default).
  • Thread it through server::runDb::connect.

Source: Foundation (Plan 0) reviews — deferred, non-blocking.

`Db::connect` hardcodes `PgPoolOptions::new().max_connections(5)` (`crates/db/src/lib.rs`). Pool sizing is operationally significant for the per-org-deployment model (total connections = sum of all org pools against the shared Postgres; see `docs/specs/2026-06-02-mvp-architecture.md` §3/§4). Promote it to configuration so it can be tuned per environment without an API change. - [ ] Accept pool size via config (e.g. a `DbConfig { url, max_connections }` or a `Config` field with a sensible default). - [ ] Thread it through `server::run` → `Db::connect`. _Source: Foundation (Plan 0) reviews — deferred, non-blocking._
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: logaritmisk/biggus-dickus#2