@powersync/common 1.57.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/lib/attachments/AttachmentContext.d.ts +5 -5
  2. package/lib/attachments/AttachmentContext.js +6 -2
  3. package/lib/attachments/AttachmentContext.js.map +1 -1
  4. package/lib/attachments/AttachmentQueue.d.ts +6 -6
  5. package/lib/attachments/AttachmentQueue.js +9 -8
  6. package/lib/attachments/AttachmentQueue.js.map +1 -1
  7. package/lib/attachments/AttachmentService.d.ts +3 -3
  8. package/lib/attachments/AttachmentService.js +4 -3
  9. package/lib/attachments/AttachmentService.js.map +1 -1
  10. package/lib/attachments/Schema.d.ts +2 -2
  11. package/lib/attachments/SyncingService.d.ts +2 -2
  12. package/lib/attachments/SyncingService.js +21 -6
  13. package/lib/attachments/SyncingService.js.map +1 -1
  14. package/lib/client/{AbstractPowerSyncDatabase.d.ts → CommonPowerSyncDatabase.d.ts} +56 -232
  15. package/lib/client/CommonPowerSyncDatabase.js +2 -0
  16. package/lib/client/CommonPowerSyncDatabase.js.map +1 -0
  17. package/lib/client/SQLOpenFactory.d.ts +35 -13
  18. package/lib/client/SQLOpenFactory.js +1 -25
  19. package/lib/client/SQLOpenFactory.js.map +1 -1
  20. package/lib/client/compilableQueryWatch.d.ts +2 -2
  21. package/lib/client/compilableQueryWatch.js +1 -2
  22. package/lib/client/compilableQueryWatch.js.map +1 -1
  23. package/lib/client/connection/PowerSyncBackendConnector.d.ts +3 -3
  24. package/lib/client/runOnSchemaChange.d.ts +2 -2
  25. package/lib/client/runOnSchemaChange.js.map +1 -1
  26. package/lib/client/sync/bucket/CrudEntry.d.ts +3 -34
  27. package/lib/client/sync/bucket/CrudEntry.js +0 -99
  28. package/lib/client/sync/bucket/CrudEntry.js.map +1 -1
  29. package/lib/client/sync/options.d.ts +65 -0
  30. package/lib/client/sync/options.js +25 -0
  31. package/lib/client/sync/options.js.map +1 -0
  32. package/lib/client/sync/sync-streams.d.ts +1 -1
  33. package/lib/client/triggers/TriggerManager.d.ts +9 -38
  34. package/lib/client/watched/GetAllQuery.d.ts +3 -3
  35. package/lib/client/watched/GetAllQuery.js +1 -1
  36. package/lib/client/watched/GetAllQuery.js.map +1 -1
  37. package/lib/client/watched/WatchedQuery.d.ts +2 -10
  38. package/lib/client/watched/WatchedQuery.js +0 -11
  39. package/lib/client/watched/WatchedQuery.js.map +1 -1
  40. package/lib/client/watched/processors/DifferentialQueryProcessor.d.ts +0 -50
  41. package/lib/client/watched/processors/DifferentialQueryProcessor.js +1 -176
  42. package/lib/client/watched/processors/DifferentialQueryProcessor.js.map +1 -1
  43. package/lib/client/watched/processors/OnChangeQueryProcessor.d.ts +0 -22
  44. package/lib/client/watched/processors/OnChangeQueryProcessor.js +1 -82
  45. package/lib/client/watched/processors/OnChangeQueryProcessor.js.map +1 -1
  46. package/lib/db/DBAdapter.d.ts +72 -154
  47. package/lib/db/DBAdapter.js +70 -108
  48. package/lib/db/DBAdapter.js.map +1 -1
  49. package/lib/db/QueryResult.d.ts +104 -0
  50. package/lib/db/QueryResult.js +96 -0
  51. package/lib/db/QueryResult.js.map +1 -0
  52. package/lib/db/crud/SyncProgress.d.ts +1 -13
  53. package/lib/db/crud/SyncProgress.js +1 -62
  54. package/lib/db/crud/SyncProgress.js.map +1 -1
  55. package/lib/db/crud/SyncStatus.d.ts +32 -66
  56. package/lib/db/crud/SyncStatus.js +1 -253
  57. package/lib/db/crud/SyncStatus.js.map +1 -1
  58. package/lib/db/schema/Column.d.ts +0 -7
  59. package/lib/db/schema/Column.js +0 -7
  60. package/lib/db/schema/Column.js.map +1 -1
  61. package/lib/db/schema/Index.d.ts +2 -6
  62. package/lib/db/schema/Index.js +1 -4
  63. package/lib/db/schema/Index.js.map +1 -1
  64. package/lib/db/schema/IndexedColumn.d.ts +2 -6
  65. package/lib/db/schema/IndexedColumn.js +1 -4
  66. package/lib/db/schema/IndexedColumn.js.map +1 -1
  67. package/lib/db/schema/Schema.d.ts +4 -28
  68. package/lib/db/schema/Schema.js.map +1 -1
  69. package/lib/db/schema/Table.d.ts +50 -96
  70. package/lib/db/schema/Table.js +83 -91
  71. package/lib/db/schema/Table.js.map +1 -1
  72. package/lib/index.d.ts +5 -21
  73. package/lib/index.js +5 -22
  74. package/lib/index.js.map +1 -1
  75. package/lib/utils/BaseObserver.d.ts +1 -1
  76. package/lib/utils/BaseObserver.js +1 -1
  77. package/lib/utils/Logger.d.ts +52 -23
  78. package/lib/utils/Logger.js +35 -33
  79. package/lib/utils/Logger.js.map +1 -1
  80. package/lib/utils/MetaBaseObserver.d.ts +11 -11
  81. package/lib/utils/MetaBaseObserver.js +1 -50
  82. package/lib/utils/MetaBaseObserver.js.map +1 -1
  83. package/lib/utils/mutex.d.ts +3 -53
  84. package/lib/utils/mutex.js +1 -156
  85. package/lib/utils/mutex.js.map +1 -1
  86. package/package.json +8 -45
  87. package/src/attachments/AttachmentContext.ts +11 -10
  88. package/src/attachments/AttachmentQueue.ts +15 -14
  89. package/src/attachments/AttachmentService.ts +7 -6
  90. package/src/attachments/Schema.ts +2 -2
  91. package/src/attachments/SyncingService.ts +23 -9
  92. package/src/client/CommonPowerSyncDatabase.ts +540 -0
  93. package/src/client/SQLOpenFactory.ts +38 -22
  94. package/src/client/compilableQueryWatch.ts +3 -4
  95. package/src/client/connection/PowerSyncBackendConnector.ts +3 -3
  96. package/src/client/runOnSchemaChange.ts +2 -2
  97. package/src/client/sync/bucket/CrudEntry.ts +4 -104
  98. package/src/client/sync/options.ts +77 -0
  99. package/src/client/sync/sync-streams.ts +1 -1
  100. package/src/client/triggers/TriggerManager.ts +10 -41
  101. package/src/client/watched/GetAllQuery.ts +3 -3
  102. package/src/client/watched/WatchedQuery.ts +2 -15
  103. package/src/client/watched/processors/DifferentialQueryProcessor.ts +0 -223
  104. package/src/client/watched/processors/OnChangeQueryProcessor.ts +0 -111
  105. package/src/db/DBAdapter.ts +141 -226
  106. package/src/db/QueryResult.ts +195 -0
  107. package/src/db/crud/SyncProgress.ts +2 -42
  108. package/src/db/crud/SyncStatus.ts +45 -220
  109. package/src/db/schema/Column.ts +0 -8
  110. package/src/db/schema/Index.ts +3 -6
  111. package/src/db/schema/IndexedColumn.ts +3 -6
  112. package/src/db/schema/Schema.ts +4 -4
  113. package/src/db/schema/Table.ts +111 -186
  114. package/src/index.ts +5 -21
  115. package/src/utils/BaseObserver.ts +1 -1
  116. package/src/utils/Logger.ts +80 -34
  117. package/src/utils/MetaBaseObserver.ts +14 -60
  118. package/src/utils/mutex.ts +4 -201
  119. package/dist/bundle.cjs +0 -14390
  120. package/dist/bundle.cjs.map +0 -1
  121. package/dist/bundle.mjs +0 -14309
  122. package/dist/bundle.mjs.map +0 -1
  123. package/dist/bundle.node.cjs +0 -12021
  124. package/dist/bundle.node.cjs.map +0 -1
  125. package/dist/bundle.node.mjs +0 -11940
  126. package/dist/bundle.node.mjs.map +0 -1
  127. package/dist/index.d.cts +0 -4651
  128. package/legacy/sync_protocol.d.ts +0 -103
  129. package/lib/client/AbstractPowerSyncDatabase.js +0 -990
  130. package/lib/client/AbstractPowerSyncDatabase.js.map +0 -1
  131. package/lib/client/AbstractPowerSyncOpenFactory.d.ts +0 -28
  132. package/lib/client/AbstractPowerSyncOpenFactory.js +0 -28
  133. package/lib/client/AbstractPowerSyncOpenFactory.js.map +0 -1
  134. package/lib/client/ConnectionManager.d.ts +0 -115
  135. package/lib/client/ConnectionManager.js +0 -294
  136. package/lib/client/ConnectionManager.js.map +0 -1
  137. package/lib/client/CustomQuery.d.ts +0 -22
  138. package/lib/client/CustomQuery.js +0 -43
  139. package/lib/client/CustomQuery.js.map +0 -1
  140. package/lib/client/constants.d.ts +0 -4
  141. package/lib/client/constants.js +0 -5
  142. package/lib/client/constants.js.map +0 -1
  143. package/lib/client/sync/bucket/BucketStorageAdapter.d.ts +0 -56
  144. package/lib/client/sync/bucket/BucketStorageAdapter.js +0 -29
  145. package/lib/client/sync/bucket/BucketStorageAdapter.js.map +0 -1
  146. package/lib/client/sync/bucket/SqliteBucketStorage.d.ts +0 -37
  147. package/lib/client/sync/bucket/SqliteBucketStorage.js +0 -165
  148. package/lib/client/sync/bucket/SqliteBucketStorage.js.map +0 -1
  149. package/lib/client/sync/stream/AbstractRemote.d.ts +0 -180
  150. package/lib/client/sync/stream/AbstractRemote.js +0 -505
  151. package/lib/client/sync/stream/AbstractRemote.js.map +0 -1
  152. package/lib/client/sync/stream/AbstractStreamingSyncImplementation.d.ts +0 -265
  153. package/lib/client/sync/stream/AbstractStreamingSyncImplementation.js +0 -705
  154. package/lib/client/sync/stream/AbstractStreamingSyncImplementation.js.map +0 -1
  155. package/lib/client/sync/stream/WebsocketClientTransport.d.ts +0 -15
  156. package/lib/client/sync/stream/WebsocketClientTransport.js +0 -62
  157. package/lib/client/sync/stream/WebsocketClientTransport.js.map +0 -1
  158. package/lib/client/sync/stream/core-instruction.d.ts +0 -77
  159. package/lib/client/sync/stream/core-instruction.js +0 -30
  160. package/lib/client/sync/stream/core-instruction.js.map +0 -1
  161. package/lib/client/triggers/MemoryTriggerClaimManager.d.ts +0 -6
  162. package/lib/client/triggers/MemoryTriggerClaimManager.js +0 -21
  163. package/lib/client/triggers/MemoryTriggerClaimManager.js.map +0 -1
  164. package/lib/client/triggers/TriggerManagerImpl.d.ts +0 -39
  165. package/lib/client/triggers/TriggerManagerImpl.js +0 -410
  166. package/lib/client/triggers/TriggerManagerImpl.js.map +0 -1
  167. package/lib/client/watched/processors/AbstractQueryProcessor.d.ts +0 -68
  168. package/lib/client/watched/processors/AbstractQueryProcessor.js +0 -151
  169. package/lib/client/watched/processors/AbstractQueryProcessor.js.map +0 -1
  170. package/lib/db/ConnectionClosedError.d.ts +0 -12
  171. package/lib/db/ConnectionClosedError.js +0 -23
  172. package/lib/db/ConnectionClosedError.js.map +0 -1
  173. package/lib/db/schema/TableV2.d.ts +0 -11
  174. package/lib/db/schema/TableV2.js +0 -11
  175. package/lib/db/schema/TableV2.js.map +0 -1
  176. package/lib/utils/AbortOperation.d.ts +0 -11
  177. package/lib/utils/AbortOperation.js +0 -21
  178. package/lib/utils/AbortOperation.js.map +0 -1
  179. package/lib/utils/ControlledExecutor.d.ts +0 -31
  180. package/lib/utils/ControlledExecutor.js +0 -54
  181. package/lib/utils/ControlledExecutor.js.map +0 -1
  182. package/lib/utils/async.d.ts +0 -46
  183. package/lib/utils/async.js +0 -147
  184. package/lib/utils/async.js.map +0 -1
  185. package/lib/utils/compatibility.d.ts +0 -8
  186. package/lib/utils/compatibility.js +0 -9
  187. package/lib/utils/compatibility.js.map +0 -1
  188. package/lib/utils/parseQuery.d.ts +0 -12
  189. package/lib/utils/parseQuery.js +0 -20
  190. package/lib/utils/parseQuery.js.map +0 -1
  191. package/lib/utils/queue.d.ts +0 -16
  192. package/lib/utils/queue.js +0 -42
  193. package/lib/utils/queue.js.map +0 -1
  194. package/lib/utils/stream_transform.d.ts +0 -41
  195. package/lib/utils/stream_transform.js +0 -211
  196. package/lib/utils/stream_transform.js.map +0 -1
  197. package/src/client/AbstractPowerSyncDatabase.ts +0 -1408
  198. package/src/client/AbstractPowerSyncOpenFactory.ts +0 -45
  199. package/src/client/ConnectionManager.ts +0 -405
  200. package/src/client/CustomQuery.ts +0 -56
  201. package/src/client/constants.ts +0 -4
  202. package/src/client/sync/bucket/BucketStorageAdapter.ts +0 -65
  203. package/src/client/sync/bucket/SqliteBucketStorage.ts +0 -202
  204. package/src/client/sync/stream/AbstractRemote.ts +0 -644
  205. package/src/client/sync/stream/AbstractStreamingSyncImplementation.ts +0 -970
  206. package/src/client/sync/stream/WebsocketClientTransport.ts +0 -82
  207. package/src/client/sync/stream/core-instruction.ts +0 -109
  208. package/src/client/triggers/MemoryTriggerClaimManager.ts +0 -25
  209. package/src/client/triggers/TriggerManagerImpl.ts +0 -501
  210. package/src/client/watched/processors/AbstractQueryProcessor.ts +0 -226
  211. package/src/db/ConnectionClosedError.ts +0 -25
  212. package/src/db/schema/TableV2.ts +0 -11
  213. package/src/utils/AbortOperation.ts +0 -19
  214. package/src/utils/ControlledExecutor.ts +0 -78
  215. package/src/utils/async.ts +0 -185
  216. package/src/utils/compatibility.ts +0 -9
  217. package/src/utils/parseQuery.ts +0 -31
  218. package/src/utils/queue.ts +0 -48
  219. package/src/utils/stream_transform.ts +0 -260
@@ -1,265 +0,0 @@
1
- import { ILogger } from 'js-logger';
2
- import { SyncStatus, SyncStatusOptions } from '../../../db/crud/SyncStatus.js';
3
- import { BaseListener, BaseObserver, BaseObserverInterface, Disposable } from '../../../utils/BaseObserver.js';
4
- import { BucketStorageAdapter } from '../bucket/BucketStorageAdapter.js';
5
- import { AbstractRemote, FetchStrategy } from './AbstractRemote.js';
6
- import { StreamingSyncRequestParameterType } from './JsonValue.js';
7
- /**
8
- * @internal
9
- */
10
- export declare enum LockType {
11
- CRUD = "crud",
12
- SYNC = "sync"
13
- }
14
- /**
15
- * @public
16
- */
17
- export declare enum SyncStreamConnectionMethod {
18
- HTTP = "http",
19
- WEB_SOCKET = "web-socket"
20
- }
21
- /**
22
- * @deprecated Deprecated since {@link SyncClientImplementation.RUST} is the only option.
23
- * @public
24
- */
25
- export declare enum SyncClientImplementation {
26
- /**
27
- * This implementation offloads the sync line decoding and handling into the PowerSync
28
- * core extension.
29
- *
30
- * This is the only option, as an older JavaScript client implementation has been removed from the SDK.
31
- *
32
- * ## Compatibility warning
33
- *
34
- * The Rust sync client stores sync data in a format that is slightly different than the one used
35
- * by the old JavaScript client. When adopting the {@link SyncClientImplementation.RUST} client on existing databases,
36
- * the PowerSync SDK will migrate the format automatically.
37
- *
38
- * SDK versions supporting both the JavaScript and the Rust client support both formats with the JavaScript client
39
- * implementaiton. However, downgrading to an SDK version that only supports the JavaScript client would not be
40
- * possible anymore. Problematic SDK versions have been released before 2025-06-09.
41
- */
42
- RUST = "rust"
43
- }
44
- /**
45
- * The default {@link SyncClientImplementation} to use, {@link SyncClientImplementation.RUST}.
46
- *
47
- * @deprecated Deprecated since {@link SyncClientImplementation.RUST} is the only option.
48
- * @public
49
- */
50
- export declare const DEFAULT_SYNC_CLIENT_IMPLEMENTATION = SyncClientImplementation.RUST;
51
- /**
52
- * Abstract Lock to be implemented by various JS environments
53
- *
54
- * @internal
55
- */
56
- export interface LockOptions<T> {
57
- callback: () => Promise<T>;
58
- type: LockType;
59
- signal?: AbortSignal;
60
- }
61
- /**
62
- * @internal
63
- */
64
- export interface AbstractStreamingSyncImplementationOptions extends RequiredAdditionalConnectionOptions {
65
- adapter: BucketStorageAdapter;
66
- subscriptions: SubscribedStream[];
67
- uploadCrud: () => Promise<void>;
68
- /**
69
- * An identifier for which PowerSync DB this sync implementation is
70
- * linked to. Most commonly DB name, but not restricted to DB name.
71
- */
72
- identifier?: string;
73
- logger?: ILogger;
74
- remote: AbstractRemote;
75
- }
76
- /**
77
- * @internal
78
- */
79
- export interface StreamingSyncImplementationListener extends BaseListener {
80
- /**
81
- * Triggered whenever a status update has been attempted to be made or
82
- * refreshed.
83
- */
84
- statusUpdated?: ((statusUpdate: SyncStatusOptions) => void) | undefined;
85
- /**
86
- * Triggers whenever the status' members have changed in value
87
- */
88
- statusChanged?: ((status: SyncStatus) => void) | undefined;
89
- }
90
- /**
91
- * Configurable options to be used when connecting to the PowerSync
92
- * backend instance.
93
- *
94
- * @public
95
- */
96
- export type PowerSyncConnectionOptions = Omit<InternalConnectionOptions, 'serializedSchema'>;
97
- /**
98
- * @internal
99
- */
100
- export interface InternalConnectionOptions extends BaseConnectionOptions, AdditionalConnectionOptions {
101
- }
102
- /** @public */
103
- export interface BaseConnectionOptions {
104
- /**
105
- * A set of metadata to be included in service logs.
106
- */
107
- appMetadata?: Record<string, string>;
108
- /**
109
- * @deprecated The Rust sync client is used unconditionally, so this option can't be configured.
110
- */
111
- clientImplementation?: SyncClientImplementation;
112
- /**
113
- * The connection method to use when streaming updates from
114
- * the PowerSync backend instance.
115
- * Defaults to a HTTP streaming connection.
116
- */
117
- connectionMethod?: SyncStreamConnectionMethod;
118
- /**
119
- * The fetch strategy to use when streaming updates from the PowerSync backend instance.
120
- */
121
- fetchStrategy?: FetchStrategy;
122
- /**
123
- * These parameters are passed to the sync rules, and will be available under the`user_parameters` object.
124
- */
125
- params?: Record<string, StreamingSyncRequestParameterType>;
126
- /**
127
- * Whether to include streams that have `auto_subscribe: true` in their definition.
128
- *
129
- * This defaults to `true`.
130
- */
131
- includeDefaultStreams?: boolean;
132
- /**
133
- * The serialized schema - mainly used to forward information about raw tables to the sync client.
134
- */
135
- serializedSchema?: any;
136
- }
137
- /** @internal */
138
- export interface AdditionalConnectionOptions {
139
- /**
140
- * Delay for retrying sync streaming operations
141
- * from the PowerSync backend after an error occurs.
142
- */
143
- retryDelayMs?: number;
144
- /**
145
- * Backend Connector CRUD operations are throttled
146
- * to occur at most every `crudUploadThrottleMs`
147
- * milliseconds.
148
- */
149
- crudUploadThrottleMs?: number;
150
- }
151
- /** @internal */
152
- export interface RequiredAdditionalConnectionOptions extends Required<AdditionalConnectionOptions> {
153
- subscriptions: SubscribedStream[];
154
- }
155
- /**
156
- * @internal
157
- */
158
- export interface StreamingSyncImplementation extends BaseObserverInterface<StreamingSyncImplementationListener>, Disposable {
159
- /**
160
- * Connects to the sync service
161
- */
162
- connect(options?: InternalConnectionOptions): Promise<void>;
163
- /**
164
- * Disconnects from the sync services.
165
- * @throws if not connected or if abort is not controlled internally
166
- */
167
- disconnect(): Promise<void>;
168
- getWriteCheckpoint: () => Promise<string>;
169
- isConnected: boolean;
170
- syncStatus: SyncStatus;
171
- triggerCrudUpload: () => void;
172
- waitForReady(): Promise<void>;
173
- waitForStatus(status: SyncStatusOptions): Promise<void>;
174
- waitUntilStatusMatches(predicate: (status: SyncStatus) => boolean): Promise<void>;
175
- updateSubscriptions(subscriptions: SubscribedStream[]): void;
176
- markConnectionMayHaveChanged(): void;
177
- }
178
- /**
179
- * @internal
180
- */
181
- export declare const DEFAULT_CRUD_UPLOAD_THROTTLE_MS = 1000;
182
- /**
183
- * @internal
184
- */
185
- export declare const DEFAULT_RETRY_DELAY_MS = 5000;
186
- /**
187
- * @internal
188
- */
189
- export declare const DEFAULT_STREAMING_SYNC_OPTIONS: {
190
- retryDelayMs: number;
191
- crudUploadThrottleMs: number;
192
- };
193
- /**
194
- * @internal
195
- */
196
- export type RequiredPowerSyncConnectionOptions = Required<BaseConnectionOptions>;
197
- /**
198
- * @internal
199
- */
200
- export declare const DEFAULT_STREAM_CONNECTION_OPTIONS: RequiredPowerSyncConnectionOptions;
201
- /**
202
- * @internal
203
- */
204
- export type SubscribedStream = {
205
- name: string;
206
- params: Record<string, any> | null;
207
- };
208
- /**
209
- * @internal
210
- */
211
- export declare abstract class AbstractStreamingSyncImplementation extends BaseObserver<StreamingSyncImplementationListener> implements StreamingSyncImplementation {
212
- protected options: AbstractStreamingSyncImplementationOptions;
213
- protected abortController: AbortController | null;
214
- protected crudUpdateListener?: () => void;
215
- protected streamingSyncPromise?: Promise<[void, void]>;
216
- protected logger: ILogger;
217
- private activeStreams;
218
- private connectionMayHaveChanged;
219
- private crudUploadNotifier;
220
- private notifyCompletedUploads?;
221
- private handleActiveStreamsChange?;
222
- syncStatus: SyncStatus;
223
- constructor(options: AbstractStreamingSyncImplementationOptions);
224
- triggerCrudUpload(): void;
225
- waitForReady(): Promise<void>;
226
- waitForStatus(status: SyncStatusOptions): Promise<void>;
227
- waitUntilStatusMatches(predicate: (status: SyncStatus) => boolean): Promise<void>;
228
- get lastSyncedAt(): Date | undefined;
229
- get isConnected(): boolean;
230
- dispose(): Promise<void>;
231
- abstract obtainLock<T>(lockOptions: LockOptions<T>): Promise<T>;
232
- getWriteCheckpoint(): Promise<string>;
233
- private crudUploadLoop;
234
- private _uploadAllCrud;
235
- connect(options?: PowerSyncConnectionOptions): Promise<void>;
236
- disconnect(): Promise<void>;
237
- private streamingSync;
238
- markConnectionMayHaveChanged(): void;
239
- /**
240
- * Older versions of the JS SDK used to encode subkeys as JSON in `OplogEntry.toJSON`.
241
- * Because subkeys are always strings, this leads to quotes being added around them in `ps_oplog`.
242
- * While this is not a problem as long as it's done consistently, it causes issues when a database
243
- * created by the JS SDK is used with other SDKs, or (more likely) when the new Rust sync client
244
- * is enabled.
245
- *
246
- * So, we add a migration from the old key format (with quotes) to the new one (no quotes). The
247
- * migration is only triggered when necessary (for now). The function returns whether the new format
248
- * should be used, so that the JS SDK is able to write to updated databases.
249
- *
250
- * @param requireFixedKeyFormat - Whether we require the new format or also support the old one.
251
- * The Rust client requires the new subkey format.
252
- * @returns Whether the database is now using the new, fixed subkey format.
253
- */
254
- private requireKeyFormat;
255
- protected streamingSyncIteration(signal: AbortSignal, options?: PowerSyncConnectionOptions): Promise<RustIterationResult | null>;
256
- private receiveSyncLines;
257
- private rustSyncIteration;
258
- protected updateSyncStatus(options: SyncStatusOptions): void;
259
- private delayRetry;
260
- updateSubscriptions(subscriptions: SubscribedStream[]): void;
261
- }
262
- interface RustIterationResult {
263
- immediateRestart: boolean;
264
- }
265
- export {};