Skip to content

Commit 1f08fc5

Browse files
neaten crud throttle options
1 parent 9bc088d commit 1f08fc5

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/powersync-sdk-common/src/client/AbstractPowerSyncDatabase.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@ import { EventIterator } from 'event-iterator';
2222
export interface PowerSyncDatabaseOptions {
2323
schema: Schema;
2424
database: DBAdapter;
25+
/**
26+
* Delay for retrying sync streaming operations
27+
* from the PowerSync backend after an error occurs.
28+
*/
2529
retryDelay?: number;
30+
/**
31+
* Backend Connector CRUD operations are throttled
32+
* to occur at most every `crudUploadThrottleMs`
33+
* milliseconds.
34+
*/
2635
crudUploadThrottleMs?: number;
2736
logger?: ILogger;
2837
}

packages/powersync-sdk-common/src/client/AbstractPowerSyncOpenFactory.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DBAdapter } from '../db/DBAdapter';
22
import { Schema } from '../db/schema/Schema';
33
import { AbstractPowerSyncDatabase, PowerSyncDatabaseOptions } from './AbstractPowerSyncDatabase';
44

5-
export interface PowerSyncOpenFactoryOptions {
5+
export interface PowerSyncOpenFactoryOptions extends Partial<PowerSyncDatabaseOptions> {
66
schema: Schema;
77
/**
88
* Filename for the database.
@@ -26,7 +26,8 @@ export abstract class AbstractPowerSyncDatabaseOpenFactory {
2626
generateOptions(): PowerSyncDatabaseOptions {
2727
return {
2828
database: this.openDB(),
29-
schema: this.schema
29+
schema: this.schema,
30+
...this.options
3031
};
3132
}
3233

0 commit comments

Comments
 (0)