fullstack-apollo-express-postgresql-boilerplate icon indicating copy to clipboard operation
fullstack-apollo-express-postgresql-boilerplate copied to clipboard

Use only DATABASE_URL

Open morenoh149 opened this issue 6 years ago • 3 comments

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.

morenoh149 avatar Feb 21 '19 00:02 morenoh149

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

rwieruch avatar Feb 21 '19 02:02 rwieruch

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.

morenoh149 avatar Feb 21 '19 02:02 morenoh149

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

rwieruch avatar Mar 05 '19 05:03 rwieruch