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

Add support for DATABASE_URL as an alternative to PGURI #484

Merged
merged 1 commit into from
Jan 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs-new/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PgTyped supports common PostgreSQL environment variables:
- `PGPASSWORD`
- `PGDATABASE`
- `PGPORT`
- `PGURI`
- `PGURI` or `DATABASE_URL`

These variables will override values provided in `config.json`.

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export function parseConfig(
password: process.env.PGPASSWORD,
dbName: process.env.PGDATABASE,
port: process.env.PGPORT ? Number(process.env.PGPORT) : undefined,
uri: process.env.PGURI,
uri: process.env.PGURI ?? process.env.DATABASE_URL,
};

const {
Expand Down