Skip to content

Commit 72dc5c5

Browse files
committed
fix: enable multiple databases support for MotherDuck
MotherDuck supports multiple databases, so the explorer tree needs to pass the database name through to build correct queries.
1 parent 03c3f7a commit 72dc5c5

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

sqlit/domains/connections/providers/motherduck/adapter.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ def supports_process_worker(self) -> bool:
2222
"""MotherDuck handles concurrency server-side."""
2323
return True
2424

25+
@property
26+
def supports_multiple_databases(self) -> bool:
27+
"""MotherDuck supports multiple databases."""
28+
return True
29+
2530
def connect(self, config: ConnectionConfig) -> Any:
2631
"""Connect to MotherDuck cloud database."""
2732
duckdb = self._import_driver_module(

tests/unit/test_motherduck_adapter.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ def test_motherduck_schema_uses_password_field():
4444
assert password_field.label == "Access Token"
4545

4646

47+
def test_motherduck_supports_multiple_databases():
48+
"""Test MotherDuck reports support for multiple databases."""
49+
from sqlit.domains.connections.providers.motherduck.adapter import MotherDuckAdapter
50+
51+
adapter = MotherDuckAdapter()
52+
assert adapter.supports_multiple_databases is True
53+
54+
4755
def test_motherduck_build_select_query_with_database():
4856
"""Test MotherDuck uses three-part names (database.schema.table)."""
4957
from sqlit.domains.connections.providers.motherduck.adapter import MotherDuckAdapter

0 commit comments

Comments
 (0)