-
Notifications
You must be signed in to change notification settings - Fork 95
Enable extension loading #178
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not strictly opposed to this, but we'd also have to check these changes against the iOS/macOS dependencies and patch the cmake in my sqlite3-native-libraries repository for Android as well.
Hopefully we'll soon get a native Dart build system which would allow us to make the compile time options configurable for users.
@@ -44,7 +44,6 @@ | |||
#define SQLITE_OMIT_AUTHORIZATION | |||
#define SQLITE_UNTESTABLE | |||
#define SQLITE_OMIT_COMPILEOPTION_DIAGS | |||
#define SQLITE_OMIT_LOAD_EXTENSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can really use dlopen
with wasm either way. So it can probably stay disabled if it keeps the size of the compiled code smaller.
Just FYI, the native assets feature and toolchain integration is far enough along to compile SQLite with it on all Dart supported native platforms. I've started playing around with a package that provides an SQLite API and makes use of native assets. Here is the Support for native assets is available for standalone Dart when passing |
That's awesome @blaugold! It's also pretty neat that we're able to use The only feature missing for this library is being able to access native fields with this functionality (dart-lang/sdk#50551). We use that to bind I'll see if I can already integrate native assets for the other things though. |
As a workaround for accessing |
I've played around with it a bit in #185 - I also had to apply some workarounds for variadic |
Nice! 🤓 |
Hi @simolus3 This is the exact functionality I am also looking for. I need to enable extension loading specifically for linux and windows. I can create a separate PR to remove only the |
My main concern is that At the moment we're using native buildscripts to compile sqlite3 (CMake on Windows+Linux, NDK on Android and CocoaPods on iOS and macOS). This makes it impossible for users to customize the sqlite3 that they're getting in the end. Once native assets are stable, we can migrate from If you only need Windows and Linux either way, you can pretty much copy the |
I forgot to mention that it is already enabled on Android, iOS and macOS. There is an extension that I am loading and it works correctly on all those platforms (gradle on Android and pod on iOS and macOS). I was wondering why it isn't enabled for the remaining two platforms. My testing only indicated Windows and Linux as an issue unless I am missing something. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops - I have to apologize for pointlessly leaving this hanging so long then! I think in that case it's justified to get extension support working on Windows and Linux as well. I've just checked, we also don't have OMIT_GET_TABLE
on Android/iOS/macOS.
So I'm fine with this except that OMIT_LOAD_EXTENSION
should still be there for wasm builds, since there's no way to support it there at the moment.
I'm not sure if @FaFre is still looking for this functionality or if he will be able to merge this change. @simolus3 I also see this PR removes the I can create a new PR if @FaFre cannot make those changes and merge this PR. Does |
A new PR would be helpful, thanks!
I think a patch bump is fine, this is more of a consistency fix than a new feature. |
Cool that this found its way into the package now! Guess I can close this now :) |
This PR is a draft to enable manual extensions loading via manual C-API call (https://www.sqlite.org/c3ref/enable_load_extension.html) for the built binaries.
Also I removed
SQLITE_OMIT_GET_TABLE
which is removing functions that are required by some extensions e.g. spatialite.