Skip to content

Commit 07e8616

Browse files
committed
Add changelog entry
1 parent 834955a commit 07e8616

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

CHANGELOG.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
11
# Changelog
22

3-
## 1.1.2 (pending)
4-
3+
## 1.2.0 (pending)
4+
5+
* Add a new sync client implementation written in Rust instead of Kotlin. While this client is still
6+
experimental, we intend to make it the default in the future. The main benefit of this client is
7+
faster sync performance, but upcoming features will also require this client. We encourage
8+
interested users to try it out by opting in to `ExperimentalPowerSyncAPI` and passing options when
9+
connecting:
10+
```Kotlin
11+
//@file:OptIn(ExperimentalPowerSyncAPI::class)
12+
database.connect(MyConnector(), options = SyncOptions(
13+
newClientImplementation = true,
14+
))
15+
```
16+
Switching between the clients can be done at any time without compatibility issues. If you run
17+
into issues with the new client, please reach out to us!
18+
* In addition to HTTP streams, the Kotlin SDK also supports fetching sync instructions from the
19+
PowerSync service in a binary format. This requires the new sync client, and can then be enabled
20+
on the sync options:
21+
```Kotlin
22+
//@file:OptIn(ExperimentalPowerSyncAPI::class)
23+
database.connect(MyConnector(), options = SyncOptions(
24+
newClientImplementation = true,
25+
method = ConnectionMethod.WebSocket()
26+
))
27+
```
528
* [Android, JVM] Use version `0.4.0` of `powersync-sqlite-core`.
629

730
## 1.1.1

core/src/commonMain/kotlin/com/powersync/db/internal/PowerSyncVersion.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal data class PowerSyncVersion(
1818
override fun toString(): String = "$major.$minor.$patch"
1919

2020
companion object {
21-
val MINIMUM: PowerSyncVersion = PowerSyncVersion(0, 3, 14)
21+
val MINIMUM: PowerSyncVersion = PowerSyncVersion(0, 4, 0)
2222

2323
fun parse(from: String): PowerSyncVersion {
2424
val versionInts: List<Int> =

demos/supabase-todolist/shared/src/commonMain/kotlin/com/powersync/demos/Auth.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ package com.powersync.demos
33
import androidx.lifecycle.ViewModel
44
import androidx.lifecycle.viewModelScope
55
import co.touchlab.kermit.Logger
6+
import com.powersync.ExperimentalPowerSyncAPI
67
import com.powersync.PowerSyncDatabase
78
import com.powersync.connector.supabase.SupabaseConnector
9+
import com.powersync.sync.ConnectionMethod
10+
import com.powersync.sync.SyncOptions
811
import io.github.jan.supabase.auth.status.RefreshFailureCause
912
import io.github.jan.supabase.auth.status.SessionStatus
1013
import kotlinx.coroutines.flow.MutableStateFlow
@@ -27,6 +30,7 @@ sealed class AuthState {
2730
data object SignedIn : AuthState()
2831
}
2932

33+
@OptIn(ExperimentalPowerSyncAPI::class)
3034
internal class AuthViewModel(
3135
private val supabase: SupabaseConnector,
3236
private val db: PowerSyncDatabase,
@@ -44,7 +48,10 @@ internal class AuthViewModel(
4448
supabase.sessionStatus.collect {
4549
when (it) {
4650
is SessionStatus.Authenticated -> {
47-
db.connect(supabase)
51+
db.connect(supabase, options = SyncOptions(
52+
newClientImplementation = true,
53+
method = ConnectionMethod.WebSocket(),
54+
))
4855
}
4956
is SessionStatus.NotAuthenticated -> {
5057
db.disconnectAndClear()

0 commit comments

Comments
 (0)