Skip to content

Add CacheBehavior::AUTOMATIC to DBInstanceCache that automatically does the right thing™ - #19841

Merged
Mytherin merged 1 commit into
duckdb:v1.4-andiumfrom
Mytherin:instancecacheautomatic
Nov 19, 2025
Merged

Mytherin merged 1 commit into
duckdb:v1.4-andiumfrom
Mytherin:instancecacheautomatic

Conversation

@Mytherin

Copy link
Copy Markdown
Collaborator

This PR adds a CacheBehavior enum to the instance cache, instead of the current true / false:

enum class CacheBehavior { AUTOMATIC, ALWAYS_CACHE, NEVER_CACHE };

The default value if none is supplied is CacheBehavior::AUTOMATIC. This does what you would expect:

  • Unnamed in-memory connections are not cached (:memory: and <empty>)
  • Named in-memory connections are cached (:memory:label)
  • Regular connections are cached

This PR also switches the C API to using CacheBehavior::AUTOMATIC.

@Mytherin
Mytherin merged commit a2ae692 into duckdb:v1.4-andium Nov 19, 2025
56 checks passed
github-actions Bot pushed a commit to duckdb/duckdb-r that referenced this pull request Nov 26, 2025
Add CacheBehavior::AUTOMATIC to DBInstanceCache that automatically does the right thing™ (duckdb/duckdb#19841)
github-actions Bot added a commit to duckdb/duckdb-r that referenced this pull request Nov 26, 2025
Add CacheBehavior::AUTOMATIC to DBInstanceCache that automatically does the right thing™ (duckdb/duckdb#19841)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
@Mytherin
Mytherin deleted the instancecacheautomatic branch December 4, 2025 11:30
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.

1 participant