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
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:trueconstructor parameter toPrismaClient, 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=truequery parameter in the Postgres connection string that enables our new and improved, special PgBouncer mode in the Query Engine.(
forceTransactions:trueshould 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
forceTransactions/ pgBouncer prisma-client-js#503