Files
bun-sqlite/dist/utils/export-archive.d.ts
T

26 lines
925 B
TypeScript

export declare const ExportArchiveMembers: {
readonly DbFileName: "database.sqlite";
readonly SchemaFileName: "schema";
};
export type ExportArchiveContents = {
db: Uint8Array;
schema: string;
/** Archive member basename, e.g. schema.ts / schema.json / schema.yaml */
schemaFileName: string;
};
export declare function isArchivePath(filePath: string): boolean;
export declare function isSqlPath(filePath: string): boolean;
export declare function isSQLiteFile(bytes: Uint8Array): boolean;
/**
* Create a portable export archive (tar / tar.gz / zip) with the database
* file + schema file.
*/
export declare function writeExportArchive({ contents, outPath, }: {
contents: ExportArchiveContents;
outPath: string;
}): Promise<void>;
/**
* Read a portable export archive (tar / tar.gz / zip).
*/
export declare function readExportArchive(archivePath: string): Promise<ExportArchiveContents>;