Skip to content

Commit c6639d3

Browse files
committed
Resolve TODOs
1 parent 4d46bd0 commit c6639d3

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export interface PowerSyncDatabaseOptions {
4646
export interface SQLWatchOptions {
4747
signal?: AbortSignal;
4848
tables?: string[];
49+
/** The minimum interval between queries. */
4950
throttleMs?: number;
5051
/**
5152
* Allows for watching any SQL table
@@ -533,8 +534,8 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
533534

534535
/**
535536
* Execute a read query every time the source tables are modified.
536-
* TODO: Use throttle to specify the minimum interval between queries.
537-
* TODO: Source tables are automatically detected using `EXPLAIN QUERY PLAN`.
537+
* Use {@link SQLWatchOptions.throttleMs} to specify the minimum interval between queries.
538+
* Source tables are automatically detected using `EXPLAIN QUERY PLAN`.
538539
*/
539540
async *watch(sql: string, parameters?: any[], options?: SQLWatchOptions): AsyncIterable<QueryResult> {
540541
//Fetch initial data
@@ -622,9 +623,6 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
622623
});
623624
}
624625

625-
/**
626-
* TODO
627-
*/
628626
private async executeReadOnly(sql: string, params: any[]) {
629627
await this.waitForReady();
630628
return this.database.readLock((tx) => tx.execute(sql, params));

packages/powersync-sdk-common/src/client/sync/bucket/CrudTransaction.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { CrudBatch } from './CrudBatch';
22
import { CrudEntry } from './CrudEntry';
33

4-
/**
5-
* TODO
6-
*/
74
export class CrudTransaction extends CrudBatch {
85
constructor(
96
/**

packages/powersync-sdk-common/src/db/crud/SyncStatus.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,19 @@ export class SyncStatus {
3030
}
3131

3232
/**
33-
* TODO
33+
* Upload/download status
3434
*/
3535
get dataFlowStatus() {
3636
return (
3737
this.options.dataFlow ?? {
38+
/**
39+
* true if actively downloading changes.
40+
* This is only true when {@link connected} is also true.
41+
*/
3842
downloading: false,
43+
/**
44+
* true if uploading changes.
45+
*/
3946
uploading: false
4047
}
4148
);

0 commit comments

Comments
 (0)