@@ -34,7 +34,22 @@ public struct ConnectOptions {
3434 /// ]
3535 /// ```
3636 public var params : JsonParam
37+
38+ /// Uses a new sync client implemented in Rust instead of the one implemented in Kotlin.
39+ ///
40+ /// The new client is more efficient and will become the default in the future, but is still marked as experimental for now.
41+ /// We encourage interested users to try the new client.
42+ @_spi ( PowerSyncExperimental)
43+ public var newClientImplementation : Bool
3744
45+ /// The connection method used to connect to the Powersync service.
46+ ///
47+ /// The default method is ``ConnectionMethod/http``. Using ``ConnectionMethod/webSocket(_:)`` can
48+ /// improve performance as a more efficient binary protocol is used. However, using the websocket connection method
49+ /// requires enabling ``ConnectOptions/newClientImplementation``.
50+ @_spi ( PowerSyncExperimental)
51+ public var connectionMethod : ConnectionMethod
52+
3853 /// Initializes a `ConnectOptions` instance with optional values.
3954 ///
4055 /// - Parameters:
@@ -49,9 +64,32 @@ public struct ConnectOptions {
4964 self . crudThrottle = crudThrottle
5065 self . retryDelay = retryDelay
5166 self . params = params
67+ self . newClientImplementation = false
68+ self . connectionMethod = . http
69+ }
70+
71+ /// Initializes a ``ConnectOptions`` instance with optional values, including experimental options.
72+ @_spi ( PowerSyncExperimental)
73+ public init (
74+ crudThrottle: TimeInterval = 1 ,
75+ retryDelay: TimeInterval = 5 ,
76+ params: JsonParam = [ : ] ,
77+ newClientImplementation: Bool = false ,
78+ connectionMethod: ConnectionMethod = . http,
79+ ) {
80+ self . crudThrottle = crudThrottle
81+ self . retryDelay = retryDelay
82+ self . params = params
83+ self . newClientImplementation = newClientImplementation
84+ self . connectionMethod = connectionMethod
5285 }
5386}
5487
88+ @_spi ( PowerSyncExperimental)
89+ public enum ConnectionMethod {
90+ case http
91+ case webSocket
92+ }
5593
5694/// A PowerSync managed database.
5795///
0 commit comments