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

Database credentials for dev config? #642

Open
thojanssens opened this issue Aug 1, 2019 · 1 comment
Open

Database credentials for dev config? #642

thojanssens opened this issue Aug 1, 2019 · 1 comment

Comments

@thojanssens
Copy link

@thojanssens thojanssens commented Aug 1, 2019

Hello, I am a beginner in Elixir/Phoenix and I am having a look at your project for learning purposes.

I want to create/migrate the database but I have an error:
$ mix ecto.create

** (RuntimeError) connect raised KeyError exception: key :username not found.

One can quickly see that there are missing parameters specifying username/password:
https://github.com/thoughtbot/constable/blob/master/config/dev.exs#L41

How does it work? Where does it get the credentials from? I guess I'm not supposed to add options myself by editing the code?

Thank you for any help!

@thojanssens
Copy link
Author

@thojanssens thojanssens commented Aug 1, 2019

Alright the postgrex library will find some predefined env variables:
Keyword.put_new(:username, System.get_env("PGUSER") || System.get_env("USER"))

Maybe gotta mention that in the installation guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.