UNPKG

@useorbis/db-sdk

Version:

Orbis' Typescript SDK for building open-data experiences.

45 lines (44 loc) 1.31 kB
import { StatementHistory } from "./historyProvider.js"; import { OrbisDB, CeramicDocument } from "../../index.js"; export declare class BulkInsertStatement<T = Record<string, any>> extends StatementHistory { #private; constructor(orbis: OrbisDB, tableOrModelId: string); get documents(): Array<T>; getTableName(): Promise<string | undefined>; getModelId(): Promise<string>; validate(): Promise<{ valid: true; } | { valid: false; errors: Array<{ document: T; error: string; }>; }>; value(v: T): this; values(values: Array<T>): this; context(context: string): this; run(): Promise<{ success: CeramicDocument[]; errors: { document: T; error: any; }[]; }>; } export declare class InsertStatement<T = Record<string, any>> extends StatementHistory { #private; constructor(orbis: OrbisDB, tableOrModelId: string); get document(): T | undefined; getTableName(): Promise<string | undefined>; getModelId(): Promise<string>; validate(): Promise<{ valid: true; } | { valid: false; error: string; }>; value(v: T): InsertStatement<T>; context(context: string): this; run(): Promise<CeramicDocument>; }