biokoda / actordb

ActorDB distributed SQL database
Mozilla Public License 2.0
1.9k stars 71 forks source link

Load extension library #36

Closed slanska closed 8 years ago

slanska commented 8 years ago

Is your SQLite build enabled for loading custom extension library (via load_extension call)? If so, what would be the right way to include custom library (maybe as a part of data schema)?

SergejJurecko commented 8 years ago

We could add an extensions folder and if you add any .so/.dll/.dylib files to it they will be loaded. It would of course mean those files must be present on every node.

slanska commented 8 years ago

I think that would be perfectly fine. Confirm if I understand this correctly - ActorDB will try to load all ./so/.dll/.dylib files from specific folder (assuming folder exists) automatically, upon database connection? Thanks a lot!

SergejJurecko commented 8 years ago

upon database startup

SergejJurecko commented 8 years ago

Added in latest version 0.10.23

slanska commented 8 years ago

First, I appreciate your quick feedback to my request and enabling sqlite extensions in the recent build. I tried to load my custom extension by placing .dylib file to /extensions folder (on macOS), stopping and restarting actordb service. It seems that extension was not loaded (my custom function is not recognized). Is it the right way to load extension? Do I need to modify configuration or something else?

How can I trace/debug if extension was loaded or not? Adding some console output during service start would be helpful (if it is feasible to implement). Thanks, Sergej.

SergejJurecko commented 8 years ago

You do need to modify the configuration. By default the setting is commented out (thus disabled).

slanska commented 8 years ago

What a promptness! Thanks! I modified app.config and it worked like a charm!