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

Use only DATABASE_URL #53

Open
morenoh149 opened this issue Feb 21, 2019 · 3 comments
Open

Use only DATABASE_URL #53

morenoh149 opened this issue Feb 21, 2019 · 3 comments

Comments

@morenoh149
Copy link
Contributor

the Heroku section instructs the user to add code for DATABASE_URL https://www.robinwieruch.de/graphql-apollo-server-tutorial/#graphql-server-postgresql-deployment-heroku

The DATABASE_URL env var is widely used. It would make more sense to specify this from the very beginning instead of three env vars

DATABASE=mydatabase
DATABASE_USER=postgres
DATABASE_PASSWORD=postgres

Make api only use DATABASE_URL.

@rwieruch
Copy link
Member

Good point. Can the local PostgreSQL database be used with a database URL only even though you have set up a superuser for it?

@morenoh149
Copy link
Contributor Author

I'm not sure. I use DATABASE_URL in two ways, postgres://localhost:5432/dbname and postgres://username:password@localhost:5432/dbname. If you need to specify the superuser use the latter, otherwise my system accepts my non-root user with the former.

@rwieruch
Copy link
Member

rwieruch commented Mar 5, 2019

Good to know. I will take this into account for the next edition of the book!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants