Description: The PrismaClient is instantiated with no connection pool configuration. Defaults may not be optimal for the expected load, especially for the api-gateway which handles all database traffic.
Requirements:
- Configure
connection_limit in the Prisma datasource (e.g., pool_timeout=10&connection_limit=20)
- Set appropriate pool timeout for the workloads
- Document the chosen values with rationale in comments
- Make pool size configurable via env var
DATABASE_POOL_SIZE
Suggested execution steps:
- Update
prisma.config.ts or the DATABASE_URL with ?connection_limit=20&pool_timeout=10
- Alternatively, add
DATABASE_POOL_SIZE to env schema and use it when creating PrismaClient
- Add a comment explaining the pool size rationale
Example commit message:
fix: configure Prisma connection pool size and timeout
Set connection_limit=20 and pool_timeout=10s via DATABASE_URL parameters
to prevent connection exhaustion under concurrent load.
Description: The PrismaClient is instantiated with no connection pool configuration. Defaults may not be optimal for the expected load, especially for the api-gateway which handles all database traffic.
Requirements:
connection_limitin the Prisma datasource (e.g.,pool_timeout=10&connection_limit=20)DATABASE_POOL_SIZESuggested execution steps:
prisma.config.tsor the DATABASE_URL with?connection_limit=20&pool_timeout=10DATABASE_POOL_SIZEto env schema and use it when creating PrismaClientExample commit message: