Use androidx sqlite bindings internally #230
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This restructures our internal driver implementations to be aligned with cross-platform APIs from the
androidx.sqlite:sqlite
library, and removes all internal usages of SQLiter and SQLDelight::persistence
project has been removed.:dialect
project has been removed.As a replacement, I've introduced the internal
:drivers:common
project which adds a common interface for raw SQLite connections and statements. It re-uses theandroidx.sqlite
definitions, but adds a driver that allows adding update and commit hooks (for whichandroidx.sqlite
has no API yet)). On native platforms, I'm using theandroidx.sqlite:sqlite-framework
implementation. On the JVM, I've moved the sqlite-jdbc implementation from:core
to:drivers:common
.In
:core
, the public interfaces like the cursor are then consistently implemented across the common underlyingSQLiteConnection
API.I've also added a new API to
PowerSyncDatabase
to give out a temporary view to an underlyingSQLiteConnection
. This would give users full control over the statements to run, while still letting the PowerSync SDK taking care of connection management.This is only a first step, but I hope that it makes it easier to introduce more features in the future, such as:
:drivers:common
into:drivers:sqlite3
and:drivers:sqlcipher
, and then letting users swap out driver implementations if they want an encrypted database.TODOs: