Skip to content

feat: add MotherDuck cloud DuckDB support#119

Merged
Maxteabag merged 6 commits intomainfrom
feature/motherduck-support
Jan 31, 2026
Merged

feat: add MotherDuck cloud DuckDB support#119
Maxteabag merged 6 commits intomainfrom
feature/motherduck-support

Conversation

@Maxteabag
Copy link
Owner

@Maxteabag Maxteabag commented Jan 31, 2026

Summary

Adds support for MotherDuck, a cloud-hosted DuckDB service.

  • Adds MOTHERDUCK as a new database type in the connection picker
  • Creates a dedicated provider with form fields for database name and access token
  • Inherits from DuckDBAdapter to reuse query execution, schema inspection, etc.
  • Supports both browser-based auth (when no token provided) and token-based auth

Fixes #103

Implementation

  • sqlit/domains/connections/providers/motherduck/ - new provider package
  • adapter.py - extends DuckDBAdapter, overrides connect() to build md: connection strings
  • schema.py - defines form fields (database name, access token)
  • provider.py - registers the provider with metadata
  • Updated DatabaseType enum and display order

Test plan

  • Unit tests for connection string building
  • Unit tests for provider registration and metadata
  • Manual test with MotherDuck account (requires account)

Add a new database provider for MotherDuck, the cloud-hosted DuckDB service.
This adds MotherDuck as a separate connection type with its own form fields
for database name and access token.

- Add MOTHERDUCK to DatabaseType enum
- Create motherduck provider with adapter inheriting from DuckDBAdapter
- Support md: connection strings with optional database and token
- Add unit tests for connection string building and provider registration
- Make database and access token required fields
- Use file-based URL parsing for motherduck:///database?token=xxx format
- Update tests for new requirements
- Use standard password field (stored in keyring) instead of custom token field
- Fix file-based vs tcp-based endpoint handling
- Access token is now stored securely via credentials service
MotherDuck requires database.schema.table format for queries.
Override build_select_query to include the database prefix.
MotherDuck supports multiple databases, so the explorer tree
needs to pass the database name through to build correct queries.
- Rename database field to default_database (stored in options)
- This keeps tcp_endpoint.database empty so tree shows Databases folder
- Add get_databases() to list all MotherDuck databases
- Add get_tables/get_views() with database filtering
@Maxteabag Maxteabag merged commit 8cc72bd into main Jan 31, 2026
19 of 21 checks passed
@Maxteabag Maxteabag deleted the feature/motherduck-support branch January 31, 2026 16:18
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.

create connection to motherduck database

1 participant