Provide a build-time option to dynamically link `libsqlite3.so`
Hi,
I'm trying to get better-sqlite3 working with mvsqlite. mvsqlite can LD_PRELOAD into existing SQLite applications, given that the application dynamically links to libsqlite3.so. I patched better-sqlite3's build scripts and it works.
Maybe it would be nice to have a build option to make better-sqlite3 dynamically link against the system libsqlite3, instead of statically linking to the packaged one?
Dynamic linking could be considered in the future.
I have a bad hack to do this in https://github.com/lf-/better-sqlite3/tree/shared_linking
This would be really helpful and I would like to bump this suggestion.
The current configuration is difficult to use with pnpm based projects. It requires monkey patching to get the --build-from-source option to work and is not persistent across new better-sqlite3 releases. Even the npm solution is less than ideal.
It would be nice if better-sqlite3:
- defaulted to dynamically linking the system sqlite3 library which most have,
- allowed the user to specify at runtime the location of an alternate sqlite3 library to load,
- only downloaded and compiled as a last resort.
The current build system also seems to limit the user to the amalgamation.
I'd also like to make a node-better-sqlite3 package available for OpenWRT (Linux distro for embedded devices, e.g. WiFi routers).
Currently, there is a node-sqlite3 package, but on an embedded device, pretty much every downside listed in better-sqlite3's README is much more important!
I've got a node-better-sqlite3 OpenWRT package working with static linking, but it's ineligible to become an official OpenWRT package, since pretty much every Linux package repository forbids static linking.
My issue is the current custom compile option limits you to the amalgamation and sticks you with a specific set of compile options.
This is an issue with extensions thst rely on external libraries like the included ICU unicode extension. I have to manually edit the gypi files to get it to compile with the libraries and work with out crashing.
Dynamic library inclusion would fix this issue.
+1 with variants like mvsqlite and dqlite dynamic linking is a highly desired feature!