Skip to content

PgBouncer mode #2520

@janpio

Description

@janpio

Problem

There are certain situations where putting PgBouncer in front of your Postgres database server can solve some problems for you. We want to enable our users to do that in a simple and convenient way.

Previously we thought just enabling transactions around all queries would do the job (+ setting some PgBouncer config), and added an undocumented forceTransactions:true constructor parameter to PrismaClient, but it turned out that this is not actually sufficient or not possible for some users - and the constructor is also the wrong location for this configuration.

Suggested solution

Instead we now think we want to have an optional ?pgbouncer=true query parameter in the Postgres connection string that enables our new and improved, special PgBouncer mode in the Query Engine.

(forceTransactions:true should probably be replaced with an error that tells users about this connection string query parameter - as it was undocumented not that many should use it. We can then remove this after a few more releases.)

Alternatives

None really, as we need to tell the Query Engine about this to adapt its behavior to fit the characteristics that PgBouncer expects.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions