I can turn the patch into a PR if the new command is deemed acceptable.
(Note that the signature of .load in sqlite3 is .load FILE ?ENTRY?; ~however, Python's sqlite3 doesn't seem to support loading a single entry, and I've never used the optional ENTRY either. Probably okay to keep it simple.~ I was mistaken: ENTRY here is an entry point function, usually something like sqlite3_extension_init, not a specific entry... Still, not really supported by Python's sqlite3 API — it's hard coded as 0.)
I occasionally use math functions defined in the extension library
extension-functions.c
. The library needs to be loaded into SQLite.The official
sqlite3
executable allows me to load the extension in two ways (unless compiled withSQLITE_OMIT_LOAD_EXTENSION
):litecli
however doesn't callsqlite3_enable_load_extension
, so extension loading is forbidden:One solution is to add a
.load
command like thesqlite3
one. Here's a quick patch:This way we can load an extension library (with or without quotes):
I can turn the patch into a PR if the new command is deemed acceptable.
(Note that the signature of
.load
insqlite3
is.load FILE ?ENTRY?
; ~however, Python'ssqlite3
doesn't seem to support loading a single entry, and I've never used the optionalENTRY
either. Probably okay to keep it simple.~ I was mistaken:ENTRY
here is an entry point function, usually something likesqlite3_extension_init
, not a specific entry... Still, not really supported by Python's sqlite3 API — it's hard coded as 0.)