SQLite Forum

How to make a compiled SQLite extensions available system-wide on MacOS?
Login
If you provide an absolute path in the .load command or to the sqlite3\_load\_extension() call, or to the load\_extension() SQLite function from SQL (when extension loading is enabled), then the extension specified by that path will be loaded (if it can be.)

If you want to name the extension to one of the load mechanisms without an absolute path, then you must arrange that the compiled extension can be located by the search that dlopen(...) conducts.  That can vary, but usually it examines directories specified by an environment variable, LD\_LIBRARY\_PATH, in the order listed by its colon-separated values left-to-right, then /lib and /usr/lib.

So, you can put your extension somewhere already searched, or you could use the "env" command to launch the SQLite CLI with a modified value for $LD\_LIBRARY\_PATH that includes where you put the extension. Or you might simply modify that environment variable for a session in which you are using the CLI. (This can lead to subtle problems, so be sure you understand the potential effects going into that.)