cli icon indicating copy to clipboard operation
cli copied to clipboard

Local [api] config: expose the PostgREST connection pool size (db_pool), as the hosted project config does

Open luizfneves404 opened this issue 3 weeks ago • 0 comments

Existing issues

  • [x] I have searched the existing issues.

Affected area

Local development

Problem to solve

The local PostgREST container's pool size comes from the image, and the local config has no key to change it.

  • Both ghcr.io/supabase/cli/postgrest images on our machine (digests sha256:11421115f972… and sha256:63a8d4acfdeb…) set PGRST_DB_POOL=2 in their image environment, as docker image inspect shows.
  • The CLI does not set a pool variable. The managed stack's PostgREST service builds its environment in packages/stack/src/services/Rest.ts (lines 31–54), which has no pool variable, and no pool variable appears anywhere in the CLI 3.1.0 tree. So the container uses the image value.
  • Adding db_pool = 10 under [api] in supabase/config.toml has no effect. CLI 3.1.0 prints WARN: supabase/config.toml has keys this version of the Supabase CLI does not recognize and ignores: api.db_pool.
  • The hosted project config accepts db_pool and db_pool_acquisition_timeout (packages/config/src/project-config/api-attributes.ts, lines 104–107). The local and hosted configs therefore differ.

A local test that sends concurrent requests to the Data API is limited by a pool of two connections.

Proposed solution

A local [api] db_pool key that maps to PGRST_DB_POOL, with the same name and meaning as the hosted key. The default stays at the current image value, so existing projects do not change.

Alternatives considered

None tested. The container is created by the CLI, and the CLI passes no pool variable, so the image value is the one in effect today.

Additional context

The request depends on no other change to the stack.

luizfneves404 avatar Nov 10 '26 22:11 luizfneves404