cli
cli copied to clipboard
Local [api] config: expose the PostgREST connection pool size (db_pool), as the hosted project config does
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/postgrestimages on our machine (digestssha256:11421115f972…andsha256:63a8d4acfdeb…) setPGRST_DB_POOL=2in their image environment, asdocker image inspectshows. - 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 = 10under[api]insupabase/config.tomlhas no effect. CLI 3.1.0 printsWARN: 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_poolanddb_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.