Skip to content

Commit

Permalink
fix: return singleton connection for getConnectionInfo if it's been
Browse files Browse the repository at this point in the history
created
  • Loading branch information
seveibar committed Aug 25, 2021
1 parent 92da4dd commit f073794
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ const createDatabaseGetter = ({
}

const getConnectionInfo = (database, user) => {
if (singletonDB)
return {
...singletonDB.connection,
database: database || singleton.connection.database,
user: user || singleton.connection.user,
}
const uri =
process.env.POSTGRES_URI ||
process.env.PG_URI ||
Expand Down

0 comments on commit f073794

Please sign in to comment.