{{ message }}
feat(database): add pgbouncer support and optimize postgres config#1700
Merged
DavidsonGomes merged 3 commits intoEvolutionAPI:developfrom Jul 14, 2025
Merged
Conversation
- Add pgbouncer service to handle connection pooling - Update database connection URIs to support direct and pooled connections - Optimize postgres configuration with better memory settings - Update prisma schema to support directUrl connection
Contributor
Contributor
There was a problem hiding this comment.
Hey @guilherme-aguilar - I've reviewed your changes - here's some feedback:
- Extract database credentials (user, password, and database name) into environment variables or a .env file instead of hard-coding them in docker-compose for better flexibility and security.
- Add healthcheck definitions for both the postgres and pgbouncer services to ensure dependent services wait for the database to be fully ready before starting.
- After updating the Prisma schema with the new directUrl, remember to regenerate the Prisma client and verify any related migrations are applied.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Extract database credentials (user, password, and database name) into environment variables or a .env file instead of hard-coding them in docker-compose for better flexibility and security.
- Add healthcheck definitions for both the postgres and pgbouncer services to ensure dependent services wait for the database to be fully ready before starting.
- After updating the Prisma schema with the new directUrl, remember to regenerate the Prisma client and verify any related migrations are applied.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
added 2 commits
July 8, 2025 18:09
- Add new psql_bouncer database provider option - Update database scripts to handle psql_bouncer provider - Comment out pgbouncer service in docker-compose - Simplify postgresql schema by removing directUrl - Add new psql_bouncer-schema.prisma file - Update .env.example with psql_bouncer configuration - Modify runWithProvider.js to handle psql_bouncer migrations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary by Sourcery
Add PgBouncer for connection pooling, support both pooled and direct PostgreSQL connections in Prisma, and optimize PostgreSQL memory settings
New Features:
Enhancements: