Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.3.1

* Update SQLite to 3.50.3.
* Support receiving binary sync lines over HTTP when the Rust client is enabled.
* Remove the experimental websocket transport mode.

## 1.3.0

* Use version `0.4.2` of the PowerSync core extension, which improves the reliability
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ if let kotlinSdkPath = localKotlinSdkOverride {
// Not using a local build, so download from releases
conditionalTargets.append(.binaryTarget(
name: "PowerSyncKotlin",
url: "https://github.com/powersync-ja/powersync-kotlin/releases/download/v1.3.0/PowersyncKotlinRelease.zip",
checksum: "5351c0a89e74ceaad570cd5c016c8ea4b8e10dc404daff3c20485ae0b6b989fa"
url: "https://github.com/powersync-ja/powersync-kotlin/releases/download/v1.3.1/PowersyncKotlinRelease.zip",
checksum: "b01b72cbf88a2e7b9b67efce966799493fc48d4523b5989d8c645ed182880975"
))
}

Expand Down
6 changes: 0 additions & 6 deletions Sources/PowerSync/Kotlin/KotlinPowerSyncDatabaseImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,13 @@ final class KotlinPowerSyncDatabaseImpl: PowerSyncDatabaseProtocol {
)

let resolvedOptions = options ?? ConnectOptions()
let useWebsockets = switch (resolvedOptions.connectionMethod) {
case .http: false
case .webSocket: true
}

try await kotlinDatabase.connect(
connector: connectorAdapter,
crudThrottleMs: Int64(resolvedOptions.crudThrottle * 1000),
retryDelayMs: Int64(resolvedOptions.retryDelay * 1000),
params: resolvedOptions.params.mapValues { $0.toKotlinMap() },
options: createSyncOptions(
newClient: resolvedOptions.newClientImplementation,
webSocket: useWebsockets,
userAgent: "PowerSync Swift SDK"
)
)
Expand Down
19 changes: 1 addition & 18 deletions Sources/PowerSync/Protocol/PowerSyncDatabaseProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ public struct ConnectOptions {
/// We encourage interested users to try the new client.
@_spi(PowerSyncExperimental)
public var newClientImplementation: Bool

/// The connection method used to connect to the Powersync service.
///
/// The default method is ``ConnectionMethod/http``. Using ``ConnectionMethod/webSocket(_:)`` can
/// improve performance as a more efficient binary protocol is used. However, using the websocket connection method
/// requires enabling ``ConnectOptions/newClientImplementation``.
@_spi(PowerSyncExperimental)
public var connectionMethod: ConnectionMethod

/// Initializes a `ConnectOptions` instance with optional values.
///
Expand All @@ -65,7 +57,6 @@ public struct ConnectOptions {
self.retryDelay = retryDelay
self.params = params
self.newClientImplementation = false
self.connectionMethod = .http
}

/// Initializes a ``ConnectOptions`` instance with optional values, including experimental options.
Expand All @@ -74,23 +65,15 @@ public struct ConnectOptions {
crudThrottle: TimeInterval = 1,
retryDelay: TimeInterval = 5,
params: JsonParam = [:],
newClientImplementation: Bool = false,
connectionMethod: ConnectionMethod = .http
newClientImplementation: Bool = false
) {
self.crudThrottle = crudThrottle
self.retryDelay = retryDelay
self.params = params
self.newClientImplementation = newClientImplementation
self.connectionMethod = connectionMethod
}
}

@_spi(PowerSyncExperimental)
public enum ConnectionMethod {
case http
case webSocket
}

/// A PowerSync managed database.
///
/// Use one instance per database file.
Expand Down
Loading