Skip to content

Conversation

Mytherin
Copy link
Collaborator

@Mytherin Mytherin commented Nov 9, 2023

This PR adds support for ATTACH IF NOT EXISTS. Instead of throwing an error the attaching of a database will be skipped if a database with that name already exists.

@szarnyasg szarnyasg added the Needs Documentation Use for issues or PRs that require changes in the documentation label Nov 9, 2023
@github-actions github-actions bot marked this pull request as draft November 9, 2023 16:38
@Mytherin Mytherin marked this pull request as ready for review November 9, 2023 16:54
@github-actions github-actions bot marked this pull request as draft November 9, 2023 19:54
@Mytherin Mytherin marked this pull request as ready for review November 9, 2023 19:54
ATTACH '__TEST_DIR__/attach_if_not_exists.db' AS db1

statement ok
ATTACH IF NOT EXISTS '__TEST_DIR__/attach_if_not_exists.db' AS db1
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens when we attach if not exists with a different alias?

Copy link
Contributor

@taniabogatsch taniabogatsch left a comment

Choose a reason for hiding this comment

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

Cool! I've added a comment about read-only situations. :)

@github-actions github-actions bot marked this pull request as draft November 10, 2023 09:54
@Mytherin Mytherin marked this pull request as ready for review November 10, 2023 09:55
@Mytherin Mytherin merged commit 897b6b9 into duckdb:feature Nov 10, 2023
@Mytherin Mytherin deleted the attachifnotexists branch December 4, 2023 11:45
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request Dec 11, 2023
Merge pull request duckdb/duckdb#9392 from lnkuiper/parquet_encryption
Merge pull request duckdb/duckdb#9461 from hawkfish/merge-sort-trees
Merge pull request duckdb/duckdb#8788 from alnkesq/capi_create_enum_type
Merge pull request duckdb/duckdb#9513 from Tmonster/5614-database-invalidated
Merge pull request duckdb/duckdb#9622 from Mytherin/typescoping
Merge pull request duckdb/duckdb#9615 from hawkfish/strptime-infinity
Merge pull request duckdb/duckdb#9627 from Mytherin/attachifnotexists
Merge pull request duckdb/duckdb#9648 from samansmink/add-keep-alive-toggle
Merge pull request duckdb/duckdb#9638 from taniabogatsch/bench-refactor
Merge pull request duckdb/duckdb#9651 from Mytherin/getenv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Documentation Use for issues or PRs that require changes in the documentation Ready To Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants