Skip to content

Commit

Permalink
Fix standard postgres user env var (#20)
Browse files Browse the repository at this point in the history
* Fix standard postgres user env var

psql defined PGUSER, not PGUSERNAME

* Preserve existing behaviour

Then the wrong env var can go in the next major
  • Loading branch information
emilbayes authored and porsager committed Jan 21, 2020
1 parent cbe7cac commit cce5ad7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ function parseOptions(a, b) {
port,
path : o.path || host.indexOf('/') > -1 && host + '/.s.PGSQL.' + port,
database : o.database || o.db || (url.pathname || '').slice(1) || env.PGDATABASE || 'postgres',
user : o.user || o.username || auth[0] || env.PGUSERNAME || os.userInfo().username,
user : o.user || o.username || auth[0] || env.PGUSERNAME || env.PGUSER || os.userInfo().username,
pass : o.pass || o.password || auth[1] || env.PGPASSWORD || '',
max : o.max || url.query.max || Math.max(1, os.cpus().length),
types : o.types || {},
Expand Down

0 comments on commit cce5ad7

Please sign in to comment.