Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config examples #12

Merged
merged 2 commits into from
Nov 20, 2020
Merged

Add config examples #12

merged 2 commits into from
Nov 20, 2020

Conversation

karlhorky
Copy link
Contributor

Hi @lukeed 👋

Since these are kind of common use cases, I thought I would surface these config examples in the readme - what do you think?

if (process.env.DATABASE_URL) {
const url = require('url');

// Extract the connection information from the Heroku environment variable
Copy link
Owner

Choose a reason for hiding this comment

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

Thanks!

I generally prefer low-level demonstrations like this (for clarity) but given that connection strings can be pretty wild, do you think it'd make sense to link to pg-connection-string directly for the "official" example?

Could also mention that pg users/drivers can define a connectionString directly, skipping the need to manually parse: https://node-postgres.com/features/connecting#connection-uri

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, switched to pg-connection-string.

I was thinking of also including a comment about pg, but I think that will muddle this specific example, because then it will be about using module.exports again... what do you think?

Copy link
Owner

Choose a reason for hiding this comment

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

Meh, I think this is fine. Users of pg should be able to find the connectionString option on their own. But even if they don't, this configuration works across the board.

Copy link
Owner

@lukeed lukeed left a comment

Choose a reason for hiding this comment

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

Thanks!

@lukeed lukeed merged commit f5da929 into lukeed:master Nov 20, 2020
@karlhorky
Copy link
Contributor Author

Awesome, glad to help - thanks for the merge!

@karlhorky karlhorky deleted the patch-1 branch November 20, 2020 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants