You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment (I hope this gets a lot easier with the native assets SDK feature), you can't pass custom compiler flags to the buildscripts in sqlite3_flutter_libs. So the first step is to fork that package and add the relevant definitions for the platforms you need unfortunately.
Once you have the functions available, you can write bindings to them using dart:ffi. You'll need the sqlite3* pointer to the database connection drift uses. You get access to the underlying database in the setup method on NativeDatabase constructors and you can use .handle to get the native pointer to use when calling other sqlite3 functions (it might be easier to start with a local database instead of using background isolates to have everything available in the same isolate).
With the database pointer, it should be possible to create changesets and apply them. How to best integrate that functionality into drift is another question. You could call the methods to create sessions synchronously, then use drift methods to run statements and once that's done, use another C call to obtain a changeset.
What would be the best way to explore using the official SQLite Session Extension with Drift?
https://sqlite.org/sessionintro.html
From my research the API is in C, and would need some compile flags passed to the custom sqlite build.
I did find an interesting example for iOS/MacOS:
https://github.com/gerdemb/SQLiteChangesetSync
The text was updated successfully, but these errors were encountered: