Skip to content

Commit 3e1f84b

Browse files
committed
update readme for macos sqlite3 .load issue
1 parent 3642894 commit 3e1f84b

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,55 @@ It then exposes a method, `SqliteExtensions::UUID.to_path`, which returns the lo
7474

7575
This can be passed to [sqlite3](https://github.com/sparklemotion/sqlite3-ruby) in `Database.new(extensions: [])` or `Database#load_extension`.
7676

77+
## Issues
78+
79+
### Missing `.load` command
80+
81+
The default `sqlite3` on MacOS doesn't allow loading runtime extensions, so you'll need to use the version from `brew` instead (`brew install sqlite3`).
82+
83+
```console
84+
% /usr/bin/sqlite3
85+
SQLite version 3.43.2 2023-10-10 13:08:14
86+
Enter ".help" for usage hints.
87+
Connected to a transient in-memory database.
88+
Use ".open FILENAME" to reopen on a persistent database.
89+
sqlite> .load
90+
Error: unknown command or invalid arguments: "load". Enter ".help" for help
91+
```
92+
93+
You can do so by following the suggestions from `brew info sqlite3`:
94+
95+
```console
96+
% brew info sqlite3
97+
...
98+
==> Caveats
99+
sqlite is keg-only, which means it was not symlinked into /opt/homebrew,
100+
because macOS already provides this software and installing another version in
101+
parallel can cause all kinds of trouble.
102+
103+
If you need to have sqlite first in your PATH, run:
104+
echo 'export PATH="/opt/homebrew/opt/sqlite/bin:$PATH"' >> ~/.zshrc
105+
106+
For compilers to find sqlite you may need to set:
107+
export LDFLAGS="-L/opt/homebrew/opt/sqlite/lib"
108+
export CPPFLAGS="-I/opt/homebrew/opt/sqlite/include"
109+
110+
For pkg-config to find sqlite you may need to set:
111+
export PKG_CONFIG_PATH="/opt/homebrew/opt/sqlite/lib/pkgconfig"
112+
```
113+
114+
Afterwards, to check that `.load` support works:
115+
116+
```console
117+
% sqlite3
118+
SQLite version 3.50.1 2025-06-06 14:52:32
119+
Enter ".help" for usage hints.
120+
Connected to a transient in-memory database.
121+
Use ".open FILENAME" to reopen on a persistent database.
122+
(ins)sqlite> .load
123+
Usage: .load FILE ?ENTRYPOINT?
124+
```
125+
77126
## Development
78127

79128
```shell

0 commit comments

Comments
 (0)