Skip to content

Commit 3c4eb72

Browse files
chore: revert changes and update version (#95)
1 parent b029624 commit 3c4eb72

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 1.0.0-BETA14
4+
5+
* Add JVM compatibility
6+
* Revert previous iOS changes as they resulted in further issues.
7+
38
## 1.0.0-BETA13
49

510
* Move iOS database driver to use IO dispatcher which should avoid race conditions and improve performance.

core/src/commonMain/kotlin/com/powersync/db/PowerSyncDatabaseImpl.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,9 @@ internal class PowerSyncDatabaseImpl(
225225
mapper: (SqlCursor) -> RowType,
226226
): Flow<List<RowType>> = internalDb.watch(sql, parameters, mapper)
227227

228-
override suspend fun <R> readTransaction(callback: suspend (tx: PowerSyncTransaction) -> R): R =
229-
internalDb.readTransaction { tx ->
230-
callback(tx)
231-
}
228+
override suspend fun <R> readTransaction(callback: suspend (tx: PowerSyncTransaction) -> R): R = internalDb.writeTransaction(callback)
232229

233-
override suspend fun <R> writeTransaction(callback: suspend (tx: PowerSyncTransaction) -> R): R =
234-
internalDb.writeTransaction { tx ->
235-
callback(tx)
236-
}
230+
override suspend fun <R> writeTransaction(callback: suspend (tx: PowerSyncTransaction) -> R): R = internalDb.writeTransaction(callback)
237231

238232
override suspend fun execute(
239233
sql: String,

core/src/iosMain/kotlin/com/powersync/DatabaseDriverFactory.ios.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import kotlinx.cinterop.asStableRef
1717
import kotlinx.cinterop.staticCFunction
1818
import kotlinx.cinterop.toKString
1919
import kotlinx.coroutines.CoroutineScope
20-
import kotlinx.coroutines.Dispatchers
21-
import kotlinx.coroutines.IO
2220

2321
@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
2422
@OptIn(ExperimentalForeignApi::class)
@@ -53,13 +51,10 @@ public actual class DatabaseDriverFactory {
5351
scope: CoroutineScope,
5452
dbFilename: String,
5553
): PsSqlDriver {
56-
val dbDispatcher = Dispatchers.IO
57-
val dbScope = CoroutineScope(scope.coroutineContext + dbDispatcher)
58-
5954
val schema = InternalSchema.synchronous()
6055
this.driver =
6156
PsSqlDriver(
62-
scope = dbScope,
57+
scope = scope,
6358
driver =
6459
NativeSqliteDriver(
6560
configuration =

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ development=true
1717
RELEASE_SIGNING_ENABLED=true
1818
# Library config
1919
GROUP=com.powersync
20-
LIBRARY_VERSION=1.0.0-BETA13
20+
LIBRARY_VERSION=1.0.0-BETA14
2121
GITHUB_REPO=https://github.com/powersync-ja/powersync-kotlin.git
2222
# POM
2323
POM_URL=https://github.com/powersync-ja/powersync-kotlin/

0 commit comments

Comments
 (0)