feat: sqlite subdocument (#2816)

Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
Peng XiaoandAlex Yang authored and GitHub committed 2023-06-27 07:40:37 +00:00
1 parent 4307e1eb6b
commit 05452bb297
30 files changed
+842 -426

No files matched your search

+13 -2
View File
@@ -32,6 +32,11 @@ export interface UpdateRow {
id: number;
timestamp: Date;
data: Buffer;
docId?: string;
}
export interface InsertRow {
docId?: string;
data: Uint8Array;
}
export class Subscription {
toString(): string;
@@ -56,8 +61,14 @@ export class SqliteConnection {
getBlob(key: string): Promise<BlobRow | null>;
deleteBlob(key: string): Promise<void>;
getBlobKeys(): Promise<Array<string>>;
getUpdates(): Promise<Array<UpdateRow>>;
insertUpdates(updates: Array<Uint8Array>): Promise<void>;
getUpdates(docId?: string | undefined | null): Promise<Array<UpdateRow>>;
getUpdatesCount(docId?: string | undefined | null): Promise<number>;
getAllUpdates(): Promise<Array<UpdateRow>>;
insertUpdates(updates: Array<InsertRow>): Promise<void>;
replaceUpdates(
docId: string | undefined | null,
updates: Array<InsertRow>
): Promise<void>;
close(): Promise<void>;
get isClose(): boolean;
static validate(path: string): Promise<boolean>;