diff --git a/CHANGELOG.md b/CHANGELOG.md index 38348bec..1a46749b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.0.0-BETA14 + +* Add JVM compatibility +* Revert previous iOS changes as they resulted in further issues. + ## 1.0.0-BETA13 * Move iOS database driver to use IO dispatcher which should avoid race conditions and improve performance. diff --git a/core/src/commonMain/kotlin/com/powersync/db/PowerSyncDatabaseImpl.kt b/core/src/commonMain/kotlin/com/powersync/db/PowerSyncDatabaseImpl.kt index f7dbbae8..edabc3bb 100644 --- a/core/src/commonMain/kotlin/com/powersync/db/PowerSyncDatabaseImpl.kt +++ b/core/src/commonMain/kotlin/com/powersync/db/PowerSyncDatabaseImpl.kt @@ -225,15 +225,9 @@ internal class PowerSyncDatabaseImpl( mapper: (SqlCursor) -> RowType, ): Flow> = internalDb.watch(sql, parameters, mapper) - override suspend fun readTransaction(callback: suspend (tx: PowerSyncTransaction) -> R): R = - internalDb.readTransaction { tx -> - callback(tx) - } + override suspend fun readTransaction(callback: suspend (tx: PowerSyncTransaction) -> R): R = internalDb.writeTransaction(callback) - override suspend fun writeTransaction(callback: suspend (tx: PowerSyncTransaction) -> R): R = - internalDb.writeTransaction { tx -> - callback(tx) - } + override suspend fun writeTransaction(callback: suspend (tx: PowerSyncTransaction) -> R): R = internalDb.writeTransaction(callback) override suspend fun execute( sql: String, diff --git a/core/src/iosMain/kotlin/com/powersync/DatabaseDriverFactory.ios.kt b/core/src/iosMain/kotlin/com/powersync/DatabaseDriverFactory.ios.kt index c3a9822c..adb40057 100644 --- a/core/src/iosMain/kotlin/com/powersync/DatabaseDriverFactory.ios.kt +++ b/core/src/iosMain/kotlin/com/powersync/DatabaseDriverFactory.ios.kt @@ -17,8 +17,6 @@ import kotlinx.cinterop.asStableRef import kotlinx.cinterop.staticCFunction import kotlinx.cinterop.toKString import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.IO @Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") @OptIn(ExperimentalForeignApi::class) @@ -53,13 +51,10 @@ public actual class DatabaseDriverFactory { scope: CoroutineScope, dbFilename: String, ): PsSqlDriver { - val dbDispatcher = Dispatchers.IO - val dbScope = CoroutineScope(scope.coroutineContext + dbDispatcher) - val schema = InternalSchema.synchronous() this.driver = PsSqlDriver( - scope = dbScope, + scope = scope, driver = NativeSqliteDriver( configuration = diff --git a/gradle.properties b/gradle.properties index e4e9ef3c..d11eaedc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ development=true RELEASE_SIGNING_ENABLED=true # Library config GROUP=com.powersync -LIBRARY_VERSION=1.0.0-BETA13 +LIBRARY_VERSION=1.0.0-BETA14 GITHUB_REPO=https://github.com/powersync-ja/powersync-kotlin.git # POM POM_URL=https://github.com/powersync-ja/powersync-kotlin/