Skip to content

feat(duckdb): switch to newer ATTACH syntax for attach_sqlite() #11198

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NickCrews
Copy link
Contributor

the sqlite_attach() approach is deprecated per
https://duckdb.org/docs/stable/extensions/sqlite.html,
and the newer syntax opens up read only flag, specifiying a name for the attachment, and not overwriting tables that already exist.

This is breaking.

This is prep for work I want to do to add attach_postgres(), but I want to get the API up to date so that the two APIs can be consistent.

@NickCrews NickCrews added the breaking change Changes that introduce an API break at any level label May 9, 2025
@github-actions github-actions bot added tests Issues or PRs related to tests duckdb The DuckDB backend and removed breaking change Changes that introduce an API break at any level labels May 9, 2025
@NickCrews NickCrews added feature Features or general enhancements breaking change Changes that introduce an API break at any level sqlite The SQLite backend duckdb The DuckDB backend and removed tests Issues or PRs related to tests duckdb The DuckDB backend labels May 9, 2025
the sqlite_attach() approach is deprecated per
https://duckdb.org/docs/stable/extensions/sqlite.html,
and the newer syntax opens up read only flag, specifiying a name for the attachment, and not overwriting tables that already exist.
@NickCrews NickCrews force-pushed the duckdb-attach-sqlite branch from 9cc5741 to 80bf360 Compare May 9, 2025 02:19
@github-actions github-actions bot added the tests Issues or PRs related to tests label May 9, 2025
The name to attach the database as.
If `None`, use the default behavior of DuckDB
(as of duckdb==1.2.0 this is the basename of the path).
skip_if_exists
Copy link
Contributor Author

Choose a reason for hiding this comment

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

very explicitly choosing this language of "skip_if_exists" instead of "exist_ok" because I don't want users to think this has "CREATE OR REPLACE" semantics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Changes that introduce an API break at any level duckdb The DuckDB backend feature Features or general enhancements sqlite The SQLite backend tests Issues or PRs related to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant