Skip to content

Commit

Permalink
docs: elaborate on supported dsn parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Jan 3, 2025
1 parent f1de406 commit 8470512
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2591,6 +2591,17 @@ import {
parseDsn('postgresql://foo@localhost/bar?application_name=baz');
```
Supported parameters:
|Name|Meaning|Default|
|---|---|---|
|`application_name`|[`application_name`](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-APPLICATION-NAME)||
|`options`|[`options`](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-OPTIONS)||
|`sslcert`|The location of the [certificate](https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-CLIENTCERT).|-|
|`sslkey`|The location of the [certificate](https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-CLIENTCERT).|-|
|`sslmode`|[`sslmode`](https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-PROTECTION) (supported values: `disable`, `no-verify`, `require`)|`disable`|
|`sslrootcert`|The location of the [root certificate]((https://www.postgresql.org/docs/current/libpq-ssl.html#LIBQ-SSL-CERTIFICATES)) file.||
### <code>stringifyDsn</code>
```ts
Expand Down
5 changes: 4 additions & 1 deletion packages/utilities/src/utilities/parseDsn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ export const parseDsn = (dsn: string): ConnectionOptions => {
.describe(
'Specifies the location for the secret key used for the client certificate.',
),
sslmode: z.enum(['disable', 'no-verify', 'require']).optional(),
sslmode: z
.enum(['disable', 'no-verify', 'require'])
.optional()
.default('disable'),
sslrootcert: z
.string()
.optional()
Expand Down

0 comments on commit 8470512

Please sign in to comment.