SQLite Forum

Include extensions at compile time

Include extensions at compile time

(1) By anonymous on 2022-01-27 16:05:17 [link] [source]

How can I add extensions to SQLite at compile time without having to run .load in the shell, or configure ~/.sqliterc and add .load commands to it?

Should I modify the INCLUDE ../ext/ statements in src/shell.c.in?

(2) By jake on 2022-01-27 22:41:10 in reply to 1 [source]

One way is to use the undocumented compile option SQLITE_EXTRA_INIT as described here by Keith Medcalf.

(3) By anonymous on 2022-01-28 02:24:39 in reply to 2 [link] [source]

Anyways, I managed to include my extension at compile time without SQLITE_EXTRA_INIT. I got a checkout of the latest source, and I simply modified the src/shell.c.in includes, and added a call to the init function near the blocks of other init functions at roughly line 4767 of src/shell.c.in.

I'm just putting this here, if anyone would like to know how it's done.