Skip to content

Commit 34d073c

Browse files
committed
issue #6: don't call enable_load_extension unless there are extensions to load. this makes the adapter work on Mac OS.
1 parent e09fd45 commit 34d073c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ make
102102
This will create `digest.so`. Point to it in your profile config as shown in the
103103
example above.
104104

105+
Mac OS seems to ship with [SQLite libraries that do not have support for loading extensions compiled in](https://docs.python.org/3/library/sqlite3.html#f1),
106+
so this won't work "out of the box." Accordingly, snapshots won't work.
107+
If you need snapshot functionality, you'll need to compile SQLite/python
108+
or find a python distribution for Mac OS with this support.
109+
105110
## Development Notes / TODOs
106111

107112
...

dbt/adapters/sqlite/connections.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ def open(cls, connection):
5858
else:
5959
raise FailedToConnectException("at least one schema must be called 'main'")
6060

61-
handle.enable_load_extension(True)
62-
6361
extensions = [e for e in (connection.credentials.extensions or "").split(";") if e]
62+
63+
if len(extensions) > 0:
64+
handle.enable_load_extension(True)
65+
6466
for ext_path in extensions:
6567
handle.load_extension(ext_path)
6668

0 commit comments

Comments
 (0)