Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PgBouncer transaction pooling mode by allowing to disable prepared statements #17044

Open
incpo opened this issue Feb 4, 2025 · 1 comment
Labels
bun.js Something to do with a Bun-specific API enhancement New feature or request sql Something to do with `sql` in the "bun" module

Comments

@incpo
Copy link

incpo commented Feb 4, 2025

What is the problem this feature would solve?

When trying to use Bun's SQL client with PgBouncer in transaction pooling mode, the connection fails because PgBouncer doesn't support prepared statements. Currently, there's no way to disable prepared statements in Bun's SQL client.

What is the feature you are proposing to solve the problem?

Add configuration options to the Database constructor to disable prepared statements:

What alternatives have you considered?

  1. Using PgBouncer in session pooling mode instead of transaction pooling mode

    • Less performant
    • Doesn't scale
    • Defeats the purpose of using PgBouncer for connection pooling
  2. Connecting directly to PostgreSQL (port 5432)

    • Removes the benefits of connection pooling
    • Not suitable for high-scale applications
    • Increases database connection load
  3. Using different database clients

    • Loses Bun's performance benefits
    • Requires changing existing codebase
    • Adds unnecessary dependencies
@incpo incpo added the enhancement New feature or request label Feb 4, 2025
@nicksrandall
Copy link

This could be solved by #17029

@RiskyMH RiskyMH added sql Something to do with `sql` in the "bun" module bun.js Something to do with a Bun-specific API labels Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bun.js Something to do with a Bun-specific API enhancement New feature or request sql Something to do with `sql` in the "bun" module
Projects
None yet
Development

No branches or pull requests

3 participants