Skip to content

Commit a24258e

Browse files
wip: lite sdk
1 parent 4a83028 commit a24258e

File tree

16 files changed

+619
-396
lines changed

16 files changed

+619
-396
lines changed

packages/common/src/client/AbstractPowerSyncDatabase.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Mutex } from 'async-mutex';
21
import { EventIterator } from 'event-iterator';
32
import Logger, { ILogger } from 'js-logger';
43
import {
@@ -38,13 +37,13 @@ import {
3837
type PowerSyncConnectionOptions,
3938
type RequiredAdditionalConnectionOptions
4039
} from './sync/stream/AbstractStreamingSyncImplementation.js';
40+
import { CoreSyncStatus, coreStatusToJs } from './sync/stream/core-instruction.js';
41+
import { SyncStream } from './sync/sync-streams.js';
4142
import { TriggerManager } from './triggers/TriggerManager.js';
4243
import { TriggerManagerImpl } from './triggers/TriggerManagerImpl.js';
4344
import { DEFAULT_WATCH_THROTTLE_MS, WatchCompatibleQuery } from './watched/WatchedQuery.js';
4445
import { OnChangeQueryProcessor } from './watched/processors/OnChangeQueryProcessor.js';
4546
import { WatchedQueryComparator } from './watched/processors/comparators.js';
46-
import { coreStatusToJs, CoreSyncStatus } from './sync/stream/core-instruction.js';
47-
import { SyncStream } from './sync/sync-streams.js';
4847

4948
export interface DisconnectAndClearOptions {
5049
/** When set to false, data in local-only tables is preserved. */
@@ -195,7 +194,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
195194

196195
/**
197196
* The connector used to connect to the PowerSync service.
198-
*
197+
*
199198
* @returns The connector used to connect to the PowerSync service or null if `connect()` has not been called.
200199
*/
201200
get connector() {
@@ -204,7 +203,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
204203

205204
/**
206205
* The resolved connection options used to connect to the PowerSync service.
207-
*
206+
*
208207
* @returns The resolved connection options used to connect to the PowerSync service or null if `connect()` has not been called.
209208
*/
210209
get connectionOptions() {

packages/lite-sdk/src/client/storage/BucketStorage.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ export interface BucketStorage {
7878
*/
7979
hasCompletedSync: () => Promise<boolean>;
8080

81+
/**
82+
* Updates the local target checkpoint after CRUD items have been uploaded.
83+
* @param writeCheckpoint - Optional write checkpoint to set the local target to
84+
* - If provided, only updates if all CRUD items have been uploaded
85+
* - If not provided, sets the local target to the max op id
86+
* @returns void
87+
*/
88+
handleCrudUploaded(writeCheckpoint?: string): Promise<void>;
89+
8190
/**
8291
* Update the local target checkpoint atomically.
8392
* Only updates if no new CRUD data has been added since the checkpoint was obtained.

0 commit comments

Comments
 (0)