Skip to content

Commit 83ce77c

Browse files
committed
Fix MotherDuck segfault when switching from other database connections
Disable process worker for MotherDuck to avoid segfault that occurs when the subprocess has already loaded other database drivers before loading the DuckDB/MotherDuck native library. MotherDuck queries now run in the main process like local DuckDB.
1 parent 5d7bf06 commit 83ce77c

File tree

1 file changed

+7
-2
lines changed
  • sqlit/domains/connections/providers/motherduck

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ def name(self) -> str:
2020

2121
@property
2222
def supports_process_worker(self) -> bool:
23-
"""MotherDuck handles concurrency server-side."""
24-
return True
23+
"""Disable process worker to avoid segfault when switching from other DBs.
24+
25+
The MotherDuck/DuckDB native library has issues when loaded in a subprocess
26+
that has already loaded other database drivers. Running in the main process
27+
avoids this issue.
28+
"""
29+
return False
2530

2631
@property
2732
def supports_multiple_databases(self) -> bool:

0 commit comments

Comments
 (0)