sqlite3 icon indicating copy to clipboard operation
sqlite3 copied to clipboard

Allow configuring libsqlite location

Open mxcl opened this issue 2 years ago • 2 comments

I would like to bundle my own sqlite library, and setting the env variable is not viable. Can I pass it to the Database constructor or another config function?

mxcl avatar Jan 23 '24 01:01 mxcl

Is it viable if you import a module before sqlite3 module is referenced at all that just does Deno.env.set to set the custom sqlite library path? Currently we just load the shared library when the module is evaluated, but if it helps we can lazy load it upon creating first instance of Database class.

DjDeveloperr avatar Jan 23 '24 01:01 DjDeveloperr

Yes but that would require my app to have full --allow-env. Certainly I can do that for now but it is not my long term preference.

Edit: ah, I didn’t realize the library downloads the sqlite3 library when the module is imported. I’m going to vendor the library and remove that. Thanks for consideration of my request.

mxcl avatar Jan 23 '24 11:01 mxcl

Closing as the design of this library prevents another mechanism.

mxcl avatar Sep 05 '24 19:09 mxcl

@mxcl It can be altered without affecting performance I believe, we can make a new, manual entry point which allows configuration and make the default one from mod.ts download and cache it locally. If you are still interested, I can work on that

DjDeveloperr avatar Sep 06 '24 13:09 DjDeveloperr

Certainly would mean I don’t have to vendor and apply my mods every release! I can do the work, just didn’t think it was possible since the import mechanism seemed to be controlled by the deno runtime at module load.

mxcl avatar Sep 06 '24 20:09 mxcl