Skip to content

Commit

Permalink
feat: add support for DATABASE_URL as an alternative to PGURI (#484)
Browse files Browse the repository at this point in the history
See #381
  • Loading branch information
msakrejda authored Jan 29, 2023
1 parent 2b4ef61 commit 898110e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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 @@ -129,7 +129,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

1 comment on commit 898110e

@vercel
Copy link

@vercel vercel bot commented on 898110e Jan 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pgtyped – ./

pgtyped.vercel.app
pgtyped-adels.vercel.app
pgtyped-git-master-adels.vercel.app

Please sign in to comment.