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, SQLDelight and sqlite-jdbc::persistence
project has been removed.:dialect
project has been removed.:static-sqlite-driver
project has been removed.As a replacement, this adds the experimental
SQLiteConnectionPool
API in:core
. That API has been designed to:read()
andwrite()
methods correspond touseConnection
in Room, see the Transactor API from Room for a comparison).Since pools can now be implemented externally, there's a new (also marked as experimental)
PowerSyncDatabase.opened
method to open a PowerSync database ontop of those pools. The internal opening logic has also been refactored to call that method.Since we're now using a
BundledSQLiteDriver
fromandroidx.sqlite
, the platform-specific parts of the opening factory are greatly reduced. The only remaining platform-specific parts relate to loading the PowerSync core extension and finding a suitable default directory. The rest is now based incommon
.In
:core
, the public interfaces like the cursor are then consistently implemented across the common underlying connection pool 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.TODOs: