-
Notifications
You must be signed in to change notification settings - Fork 104
-
Problem
Currently there is a need to specify "db.password" to get proper information about the database. But as postgrestools.jsonc is committed to the repository, it should not contain any secrets, even local ones.
I tried to find a solution, but couldn't find one that works for me.
Excluding the password and passing it via cli argument works in cli-only settings, but setting cli arguments is not supported by the VSCode extension, it seems.
Suggestion
Therefore I would like to suggest the ability to use .env or environment variables to set connection details. This allows a lot of flexibility for everyone.
Example
{ // ... "db": { "host": "${POSTGRES_HOST}", "port": "${POSTGRES_PORT}", "username": "${POSTGRES_USERNAME}", "password": "${POSTGRES_PASSWORD}", // <-- prevents potential leak of passwords "database": "${POSTGRES_DATABASE}", // ... } }
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 2 replies
-
personally i'd love if more tools standardized on DATABASE_URL
env var
Beta Was this translation helpful? Give feedback.
All reactions
-
That is also a possibility, but it's less flexible, I think.
Beta Was this translation helpful? Give feedback.
All reactions
-
I don't believe it should be? it's just one fallback option when no explicit one is given
explicit config would be preferred over implicit fallbacks, but with some heuristics to try various env vars. for example bun supports a few env variables if no explicit config is given: POSTGRES_URL
DATABASE_URL
PGURL
PG_URL
TLS_POSTGRES_DATABASE_URL
TLS_DATABASE_URL
Beta Was this translation helpful? Give feedback.
All reactions
-
thanks for the feedback! We are tracking something similar in #302. adding this to the issue 👍🏼
Beta Was this translation helpful? Give feedback.