alexeyr / erlang-sqlite3

Sqlite gen_server port for Erlang. Creates, reads and writes to sqlite database.
Other
90 stars 33 forks source link

enable_load_extension #12

Closed booo closed 12 years ago

booo commented 12 years ago

Is there a way to call the c function enable_load_extension from erlang?

https://www.sqlite.org/c3ref/enable_load_extension.html

Best Regards Philipp

alexeyr commented 12 years ago

Not at the moment. Please consider making a pull request if you need it.

booo commented 12 years ago

I tried my best... https://github.com/booo/erlang-sqlite3/tree/enable_load_extension

Maybe you can review my changes and give me some advices about implementing a proper return from the port?

I'm also not sure how to test this function.

Best Regards

Philipp

rflynn commented 12 years ago

booo: what does this test do? https://github.com/booo/erlang-sqlite3/commit/20298aad29ef3499a72fae81a5502817fe65049d#L0R130

alexeyr commented 12 years ago

I think I've fixed a couple of problems https://github.com/alexeyr/erlang-sqlite3/tree/enable_load_extension), but still don't know how to test it properly. I'll merge it into master if I don't find a way as it at least doesn't break anything.

alexeyr commented 12 years ago

Merged to master. Please tell me if you find it doesn't work :)

booo commented 12 years ago

@alexeyr Thank you so much! Works fine for me.

@rflynn Depending on the input of enable_load_extension() I tried to enable or disable the extension loading feature. I never wrote a erlang binding. Maybe this was totally stupid. Who knows :)