Skip to content

Commit e41138a

Browse files
committed
fix: exclude pooler from statement_timeout
1 parent 70c38c0 commit e41138a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib/db.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ export const init: (config: PoolConfig) => {
8080
u.searchParams.delete('sslrootcert')
8181
config.connectionString = u.toString()
8282

83+
// For pooler connections like pgbouncer, statement_timeout isn't supported
84+
if (u.port !== '5432') {
85+
config.statement_timeout = undefined
86+
}
87+
8388
// sslmode: null, 'disable', 'prefer', 'require', 'verify-ca', 'verify-full', 'no-verify'
8489
// config.ssl: true, false, {}
8590
if (sslmode === null) {

0 commit comments

Comments
 (0)