UNPKG

@nichoth/replicache-supabase

Version:
19 lines 995 B
import { IDatabase, ITask } from 'pg-promise'; import type { JSONValue } from 'replicache'; import type { Storage } from 'replicache-transaction'; export type Executor = ITask<unknown>; export declare function tx<R>(fn: (executor: Executor) => R, db?: IDatabase<unknown> | undefined): Promise<R>; export declare function createDatabase(tx: Executor): Promise<void>; export declare function createSchemaVersion1(tx: Executor): Promise<void>; export declare function getGlobalVersion(executor: Executor): Promise<number>; export declare class PostgresStorage implements Storage { private _version; private _executor; constructor(version: number, executor: Executor); putEntry(key: string, value: JSONValue): Promise<void>; hasEntry(key: string): Promise<boolean>; getEntry(key: string): Promise<JSONValue | undefined>; getEntries(fromKey: string): AsyncIterable<readonly [string, JSONValue]>; delEntry(key: string): Promise<void>; } //# sourceMappingURL=db.d.ts.map