Skip to content

Commit 32feb25

Browse files
Jobiansporsager
authored andcommitted
Fix PGAPPNAME env access by prioritizing connection.application_name
Use connection.application_name if provided before falling back to PGAPPNAME env var to avoid unnecessary env access errors.
1 parent 9b92b65 commit 32feb25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deno/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ function parseOptions(a, b) {
482482
{}
483483
),
484484
connection : {
485-
application_name: env.PGAPPNAME || 'postgres.js',
486485
...o.connection,
486+
application_name: o.connection?.application_name ?? env.PGAPPNAME ?? 'postgres.js',
487487
...Object.entries(query).reduce((acc, [k, v]) => (k in defaults || (acc[k] = v), acc), {})
488488
},
489489
types : o.types || {},

0 commit comments

Comments
 (0)