Skip to content

Support connection URI in SECRETs#459

Merged
staticlibs merged 1 commit into
duckdb:mainfrom
staticlibs:secret_uri
May 4, 2026
Merged

Support connection URI in SECRETs#459
staticlibs merged 1 commit into
duckdb:mainfrom
staticlibs:secret_uri

Conversation

@staticlibs
Copy link
Copy Markdown
Member

This PR adds support for specifying the
connection URI instead of connection options in the SECRET definitions, example:

CREATE OR REPLACE SECRET my_secret (
    TYPE POSTGRES,
    URI 'postgresql://user1:pwd1@localhost:5432/mydb1?target_session_attrs=any&application_name=myapp'
);
ATTACH '' AS p1 (TYPE POSTGRES, secret my_secret);

When URI is specified in a SECRET, the ATTACH path must be empty, and no other connection options can be specified.

See #458 for supported connection options.

Fixes: #307

This PR adds support for specifying the
[connection URI](https://www.postgresql.org/docs/18/libpq-connect.html?utm_source=chatgpt.com#LIBPQ-CONNSTRING-URIS)
instead of connection options in the `SECRET` definitions, example:

```sql
CREATE OR REPLACE SECRET my_secret (
    TYPE POSTGRES,
    URI 'postgresql://user1:pwd1@localhost:5432/mydb1?target_session_attrs=any&application_name=myapp'
);
ATTACH '' AS p1 (TYPE POSTGRES, secret my_secret);
```

When `URI` is specified in a `SECRET`, the `ATTACH` path must be empty,
and no other connection options can be specified.

See duckdb#458 for supported connection options.

Fixes: duckdb#307
@staticlibs staticlibs merged commit 97e4e82 into duckdb:main May 4, 2026
7 checks passed
@staticlibs staticlibs deleted the secret_uri branch May 4, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DuckDB Secret Manager doesn't support URLs

1 participant