-
Notifications
You must be signed in to change notification settings - Fork 0
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
allow postgresql to load env variables instead of requireing connection string #34
Comments
@odama626 pgmg are you looking for similar behaviour to psql, e.g. supporting:
|
Yeah, running postgresjs() with no args does this |
I may add this so I'll keep it open, but my current thinking is not to. It's cool that postgres.js does it, but I don't really see the merit in it for pgmg. You can just set an env variable to the connection string and then use |
Yeah, I ended up having to rewrite how I was handling env variables when I was working on going to prod, I think it would be really easy to add this in, if you only get 1 arg just treat it as a migration file. Currently there isnt really a good way to do migrations locally either since I am using env files to set my variables locally so I have to load them in with bash first So far I am really enjoying the simplicity of pgmg otherwise though |
That's great to hear, I'll think about it, but after many years of only using connection strings, I don't see any advantage in having separate PGHOST, PGPORT variables etc. Connection strings are so useful, they give you a lot of power. And yes it would be easy to add, but most things are. I think it is the little conveniences we add along the way that lead to complexity down the line. For variables, e.g. role passwords etc, I just use dotenv in the migration file. Would that work for you? |
Also for local dev workflows, in upcoming release there'll be big improvements there. |
No description provided.
The text was updated successfully, but these errors were encountered: