Fix: Motherduck config and add session_name - #1399
Open
Donnype wants to merge 2 commits into
Open
Conversation
motherduck_session_name (and its deprecated alias motherduck_session_hint) can only be set during connection initialization; applying it via SET after connecting to an md: database fails with "can only be set during initialization". Add both keys to the MotherDuck connect-time config list so they can be passed through the URL query string, e.g. duckdb:///md:?motherduck_session_name=alice.
…ixed
The connect-time config whitelist listed attach_mode and saas_mode, which
are md: connection-string parameters ("md:db?attach_mode=single"), not
duckdb settings. duckdb.connect() rejects them with "The following options
were not recognized", so those whitelist entries never worked:
duckdb:///md:?attach_mode=single
-> Invalid Input Error: The following options were not recognized: attach_mode
while the real setting name fell through to a post-connect SET and failed:
duckdb:///md:?motherduck_attach_mode=single
-> setting 'motherduck_attach_mode' can only be set during initialization
Use the actual setting names (motherduck_attach_mode, motherduck_saas_mode)
so both can be passed through the URL query string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The issue
The
session_name(previouslysession_hint) can only be set during connection initialisation. A SET after connecting fails with a "can only be set during initialization". This adds the"motherduck_session_name"and (deprecated)"motherduck_session_hint"to the core config of MotherDuck.I also noticed that the other config keys were missing the required
motherduck_namespacing as well, so I updated those config keys. This didn't work before:Gives:
And
Gives:
After this change, this should work:
duckdb:///md:?motherduck_session_name=alice&motherduck_attach_mode=single.