diff --git a/cf/src/index.js b/cf/src/index.js index d24e9f9c..2f28dfb4 100644 --- a/cf/src/index.js +++ b/cf/src/index.js @@ -446,7 +446,7 @@ function parseOptions(a, b) { const ints = ['idle_timeout', 'connect_timeout', 'max_lifetime', 'max_pipeline', 'backoff', 'keep_alive'] const defaults = { - max : 10, + max : 3, ssl : false, idle_timeout : null, connect_timeout : 30, @@ -481,7 +481,7 @@ function parseOptions(a, b) { {} ), connection : { - application_name: 'postgres.js', + application_name: env.PGAPPNAME || 'postgres.js', ...o.connection, ...Object.entries(query).reduce((acc, [k, v]) => (k in defaults || (acc[k] = v), acc), {}) }, diff --git a/transpile.cf.js b/transpile.cf.js index bbe4c500..ea7f6bbd 100644 --- a/transpile.cf.js +++ b/transpile.cf.js @@ -36,4 +36,5 @@ function transpile(x) { .replace('import fs from \'fs\'', 'import { fs } from \'../polyfills.js\'') .replace('import { performance } from \'perf_hooks\'', 'import { performance } from \'../polyfills.js\'') .replace(/ from '([a-z_]+)'/g, ' from \'node:$1\'') + .replace(/(\s*max\s*:\s*)10+/, '$13') // https://github.com/porsager/postgres/issues/1023 }