pgschema icon indicating copy to clipboard operation
pgschema copied to clipboard

Feature: support load from `.env`

Open Folyd opened this issue 1 year ago • 4 comments

Similar to sqxl-cli: https://github.com/launchbadge/sqlx/tree/main/sqlx-cli#usage

Folyd avatar Sep 13 '25 13:09 Folyd

@Folyd PGPASSWORD is the only environment variable supported. Are you looking for specifying PGPASSWORD in .env or are you looking for specifying all CLI options in .env?

tianzhou avatar Sep 14 '25 14:09 tianzhou

I hope to support the DATABASE_URL env

Folyd avatar Sep 14 '25 15:09 Folyd

The current design avoids DATABASE_URL as a single option because it makes escaping password really hard (imaging if it contains @)

So are you just looking for including database url related connection paramenters in .env?

tianzhou avatar Sep 14 '25 15:09 tianzhou

Yes, like DATABASE_URL=postgres://postgres@localhost/my_database?option1=abc.

If password contains @, we can report error, or simply support all CLI options in env too.

Folyd avatar Sep 14 '25 16:09 Folyd