Skip to content

Conversation

@tomerqodo
Copy link

Benchmark PR calcom#26622

Type: Clean (correct implementation)

Original PR Title: chore: USE_POOL env var for api v2 prisma pooling
Original PR Description: ## What does this PR do?

Adds a USE_POOL env var to toggle Prisma connection pooling in API v2. When disabled (USE_POOL=false), Prisma connects directly via datasourceUrl instead of using the pg Pool. This provides flexibility for environments where connection pooling may not be desired.

Key Changes

  • Introduced db.usePool config sourced from USE_POOL env var (default: true)
  • PrismaReadService and PrismaWriteService now conditionally use PrismaPg + pg Pool or direct PrismaClient based on usePool
  • Added USE_POOL to env types and updated workers/main modules to read pool sizes with radix 10
  • Adjusted biome config to allow process.env usage within apps/api/v2 (specific files only)
  • Removed node:process imports in favor of global process (required for NestJS compatibility)

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Set USE_POOL=true (or omit it) and verify API v2 uses connection pooling
  2. Set USE_POOL=false and verify API v2 connects directly without pooling
  3. Run existing API v2 tests to ensure no regressions

Checklist for Human Review

  • Verify the conditional pooling logic in PrismaReadService and PrismaWriteService handles both modes correctly
  • Confirm biome config changes don't inadvertently disable linting rules for unintended files
  • Verify removal of node:process imports doesn't cause runtime issues in NestJS context

Updates since last revision

  • Fixed duplicate entry in biome.json includes array (apps/api/v2/src/config/app.ts was listed twice)

Link to Devin run: https://app.devin.ai/sessions/f86d6319617546c8be13351466d34332
Original PR URL: calcom#26622

@github-actions
Copy link

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "[CLEAN] Synthetic Benchmark PR #26622 - chore: USE_POOL env var for api v2 prisma pooling". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@github-actions
Copy link

This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active.

@github-actions github-actions bot added the Stale label Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants