-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I access to the underlying sqlite3 handle? #21
Comments
I'm not sure if that is within the scope of this project. Ideally, you'd interact with the connection through native rust calls. If there is functionality only accessible through ffi calls, that should be added to the library. |
I'm not necessarily opposed to adding an |
To enable extension loading with sqlite3_enable_load_extension(). let mut conn = ...;
unsafe {
ffi.sqlite3_enable_load_extension(conn.sqlite(), 1);
}
try!(conn.execute("SELECT load_extension('spatialite');", &[]));
unsafe {
// Disable further loading of extension
ffi.sqlite3_enable_load_extension(conn.sqlite(), 0);
} |
Gotcha. I will add that to the library - look for a new version later today. (Will ping here too.) |
@trlim : Version 0.0.10 should now enable you to do this: fn load_my_extension(conn: &SqliteConnection) -> SqliteResult<()> {
let _guard = try!(SqliteLoadExtensionGuard::new(conn));
// or use the SELECT version, that's fine too
conn.load_extension(Path::new("spatialite"), None)
} but you'll need to add the |
It works! Thank you. |
In my bindings, I included an unsafe expose method so that clients can use it with the ffi bindings. I bring this up because my bindings are in most ways subsumed by yours and I'd just as soon get rid of mine if they're not novel. Is it worth re-opening this issue? (Does github even support that?) |
@dckc I'm not necessarily opposed to an |
No, I'm not aware of any actual use of the Yes, I agree that use of it indicates that this library should be enhanced. |
I want to make some ffi calls after opening a connection but accessing
db
fails because it is private.I think there should be a function for that purpose but couldn't find.
The text was updated successfully, but these errors were encountered: