Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

fix: map Cloud Foundry username to pg user #10

Merged
merged 2 commits into from
Aug 24, 2020
Merged

fix: map Cloud Foundry username to pg user #10

merged 2 commits into from
Aug 24, 2020

Conversation

gregorwolf
Copy link
Contributor

Cloud Foundry provides the user in the field username the pg npm module expects user

@gregorwolf gregorwolf requested a review from vobu August 23, 2020 18:45
index.js Outdated
this._pool = new Pool(this.options.credentials)
// Cloud Foundry provides the user in the field username the pg npm module expects user
var credentials = this.options.credentials
if (credentials && credentials.username) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.options.credentials have to be defined here anyways in order to make the connect work
so why not do

this.options.credentials.user = this.options.credentials.username ? this.options.credentials.username : this.options.credentials.user
this._pool = new Pool(this.options.credentials)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the new commit.

@vobu vobu merged commit d00a6d8 into sapmentors:master Aug 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants