@@ -12,7 +12,7 @@ public struct SyncClientConfiguration {
1212 ///
1313 /// - SeeAlso: `SyncRequestLoggerConfiguration` for configuration options
1414 public let requestLogger : SyncRequestLoggerConfiguration ?
15-
15+
1616 /// Creates a new sync client configuration.
1717 /// - Parameter requestLogger: Optional network logger configuration
1818 public init ( requestLogger: SyncRequestLoggerConfiguration ? = nil ) {
@@ -26,10 +26,10 @@ public struct SyncClientConfiguration {
2626public struct ConnectOptions {
2727 /// Defaults to 1 second
2828 public static let DefaultCrudThrottle : TimeInterval = 1
29-
29+
3030 /// Defaults to 5 seconds
3131 public static let DefaultRetryDelay : TimeInterval = 5
32-
32+
3333 /// TimeInterval (in seconds) between CRUD (Create, Read, Update, Delete) operations.
3434 ///
3535 /// Default is ``ConnectOptions/DefaultCrudThrottle``.
@@ -54,14 +54,14 @@ public struct ConnectOptions {
5454 /// ]
5555 /// ```
5656 public var params : JsonParam
57-
57+
5858 /// Uses a new sync client implemented in Rust instead of the one implemented in Kotlin.
5959 ///
6060 /// The new client is more efficient and will become the default in the future, but is still marked as experimental for now.
6161 /// We encourage interested users to try the new client.
6262 @_spi ( PowerSyncExperimental)
6363 public var newClientImplementation : Bool
64-
64+
6565 /// Configuration for the sync client used for PowerSync requests.
6666 ///
6767 /// Provides options to customize network behavior including logging of HTTP
@@ -73,7 +73,7 @@ public struct ConnectOptions {
7373 ///
7474 /// - SeeAlso: `SyncClientConfiguration` for available configuration options
7575 public var clientConfiguration : SyncClientConfiguration ?
76-
76+
7777 /// Initializes a `ConnectOptions` instance with optional values.
7878 ///
7979 /// - Parameters:
@@ -90,10 +90,10 @@ public struct ConnectOptions {
9090 self . crudThrottle = crudThrottle
9191 self . retryDelay = retryDelay
9292 self . params = params
93- self . newClientImplementation = false
93+ newClientImplementation = false
9494 self . clientConfiguration = clientConfiguration
9595 }
96-
96+
9797 /// Initializes a ``ConnectOptions`` instance with optional values, including experimental options.
9898 @_spi ( PowerSyncExperimental)
9999 public init (
@@ -118,25 +118,25 @@ public struct ConnectOptions {
118118/// Use `PowerSyncDatabase.connect` to connect to the PowerSync service, to keep the local database in sync with the remote database.
119119///
120120/// All changes to local tables are automatically recorded, whether connected or not. Once connected, the changes are uploaded.
121- public protocol PowerSyncDatabaseProtocol : Queries {
121+ public protocol PowerSyncDatabaseProtocol : Queries , Sendable {
122122 /// The current sync status.
123123 var currentStatus : SyncStatus { get }
124-
124+
125125 /// Logger used for PowerSync operations
126126 var logger : any LoggerProtocol { get }
127-
127+
128128 /// Wait for the first sync to occur
129129 func waitForFirstSync( ) async throws
130-
130+
131131 /// Replace the schema with a new version. This is for advanced use cases - typically the schema
132132 /// should just be specified once in the constructor.
133133 ///
134134 /// Cannot be used while connected - this should only be called before connect.
135135 func updateSchema( schema: SchemaProtocol ) async throws
136-
136+
137137 /// Wait for the first (possibly partial) sync to occur that contains all buckets in the given priority.
138138 func waitForFirstSync( priority: Int32 ) async throws
139-
139+
140140 /// Connects to the PowerSync service and keeps the local database in sync with the remote database.
141141 ///
142142 /// The connection is automatically re-opened if it fails for any reason.
@@ -172,7 +172,7 @@ public protocol PowerSyncDatabaseProtocol: Queries {
172172 connector: PowerSyncBackendConnector ,
173173 options: ConnectOptions ?
174174 ) async throws
175-
175+
176176 /// Get a batch of crud data to upload.
177177 ///
178178 /// Returns nil if there is no data to upload.
@@ -188,7 +188,7 @@ public protocol PowerSyncDatabaseProtocol: Queries {
188188 /// data by transaction. One batch may contain data from multiple transactions,
189189 /// and a single transaction may be split over multiple batches.
190190 func getCrudBatch( limit: Int32 ) async throws -> CrudBatch ?
191-
191+
192192 /// Get the next recorded transaction to upload.
193193 ///
194194 /// Returns nil if there is no data to upload.
@@ -201,23 +201,23 @@ public protocol PowerSyncDatabaseProtocol: Queries {
201201 /// Unlike `getCrudBatch`, this only returns data from a single transaction at a time.
202202 /// All data for the transaction is loaded into memory.
203203 func getNextCrudTransaction( ) async throws -> CrudTransaction ?
204-
204+
205205 /// Convenience method to get the current version of PowerSync.
206206 func getPowerSyncVersion( ) async throws -> String
207-
207+
208208 /// Close the sync connection.
209209 ///
210210 /// Use `connect` to connect again.
211211 func disconnect( ) async throws
212-
212+
213213 /// Disconnect and clear the database.
214214 /// Use this when logging out.
215215 /// The database can still be queried after this is called, but the tables
216216 /// would be empty.
217217 ///
218218 /// - Parameter clearLocal: Set to false to preserve data in local-only tables. Defaults to `true`.
219219 func disconnectAndClear( clearLocal: Bool ) async throws
220-
220+
221221 /// Close the database, releasing resources.
222222 /// Also disconnects any active connection.
223223 ///
@@ -264,11 +264,11 @@ public extension PowerSyncDatabaseProtocol {
264264 )
265265 )
266266 }
267-
267+
268268 func disconnectAndClear( ) async throws {
269269 try await disconnectAndClear ( clearLocal: true )
270270 }
271-
271+
272272 func getCrudBatch( limit: Int32 = 100 ) async throws -> CrudBatch ? {
273273 try await getCrudBatch (
274274 limit: limit
0 commit comments