Support loading extensions (closes #136)#160
Conversation
As initial selection for SQLITE extensions we take https://github.com/nalgeon/sqlean with some additions in this fork (https://github.com/mindreframer/sqlean) + packaged as Hex package here: https://hex.pm/packages/ex_sqlean. To keep the usage for Exqlite somewhat simpler and consistent, a new module is introduced: BasicAPI. It allows simple operations without the confusion between Exqlite.Sqlite3 and Exqlite.Connection modules to execute queries and dealing with results.
|
@warmwaffles @kevinlang @cw789 Ping? |
|
@mindreframer I've never actually loaded extensions before. Do you have to unload them before you close the sqlite connection? |
|
@warmwaffles I don't think so. Just closing SQLite connection is enough. An extension is loaded in the context of a connection and does not linger around / or leak to other connections. |
|
@warmwaffles Feel free to play around and suggest some further improvements. I'm not a C programmer, so I kinda copy-pasted the NIF code together, and worked around the booleans by mapping them to 1/0 in the |
|
The C code looks completely fine. |
Thanks for asking. But I think I could not help much regarding this. If you really ask me, I think I would miss how I could use SQLean or other Plugins (if others exists). |
|
@cw789 Thanks for the feedback! I have added a section in the Readme with some code snippets about how to use SQLean extensions. |
|
@warmwaffles thanks for merging! |
|
Thanks for making. |
|
No problem. I was eyeballing sqlean a while back but decided against incorporating it into this library. Having it as an external is totally fine. |
As initial selection for SQLITE extensions we take https://github.com/nalgeon/sqlean with some additions in this fork (https://github.com/mindreframer/sqlean) + packaged as Hex package here: https://hex.pm/packages/ex_sqlean.
To keep the usage for Exqlite somewhat simpler and consistent, a new module is introduced: BasicAPI. It allows simple operations without the confusion between Exqlite.Sqlite3 and Exqlite.Connection modules to execute queries and dealing with results.