Skip to content

Fix(duckdb): Use CREATE OR REPLACE when registering secrets on cursor init to prevent an 'already exists' error#4974

Merged
erindru merged 1 commit intomainfrom
erin/duckdb-secrets
Jul 16, 2025
Merged

Fix(duckdb): Use CREATE OR REPLACE when registering secrets on cursor init to prevent an 'already exists' error#4974
erindru merged 1 commit intomainfrom
erin/duckdb-secrets

Conversation

@erindru
Copy link
Collaborator

@erindru erindru commented Jul 16, 2025

Prior to this PR, if you were using DuckDB secrets and more than 1 connection, you'd get the following error on subsequent connections:

Temporary secret with name 's3' already exists!

This PR creates secrets using CREATE OR REPLACE instead of just CREATE to prevent this.

Note that we don't use CREATE IF NOT EXISTS because we want updated credentials to replace existing credentials rather than continuing to use old credentials.

@erindru erindru force-pushed the erin/duckdb-secrets branch from 46de374 to 2e87eaf Compare July 16, 2025 02:06
@erindru erindru merged commit e2a406f into main Jul 16, 2025
27 checks passed
@erindru erindru deleted the erin/duckdb-secrets branch July 16, 2025 02:49
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.

3 participants