This is a cross-platform build of a SQLite driver using SQLite3MultipleCiphers for the PowerSync Kotlin SDK.
Note
Note that this package is currently in alpha.
This package is designed to be used with the main PowerSync SDK. On native platforms, it is incompatible with the
default com.powersync:core though.
To use this package, replace your dependency on com.powersync:core with com.powersync:common of the same version.
Also add a dependency on com.powersync:sqlite3multipleciphers.
Finally, note that :core has a dependency on a ktor client implementation for each platform. So if you're not using
ktor in your project already, you'd have to add:
- A dependency on
io.ktor:ktor-client-okhttpon Android and the JVM. - A dependency on
io.ktor:ktor-client-darwinfor Apple targets on Kotlin/Native.
Different client implementations are also available, see the overview for details.
You can continue to use PowerSyncDatabase to open databases. For the factory parameter, pass:
- On Android: An instance of
AndroidEncryptedDatabaseFactory. - For JVM targets: An instance of
JavaEncryptedDatabaseFactory. - For Kotlin/Native: An instance of
NativeEncryptedDatabaseFactory.
Each of these factories takes a Key instance used to encrypt the database.
The Android / Java sources of this package, as well as the JNI wrapper code, have been copied and adapted from
the androidx.sqlite:bundled-sqlite-driver package.