import type { Knex } from "knex"; import type { BasicAppLogger } from "./public.types.js"; export declare const METADATA_TABLE_NAME = "PaMetadata"; export declare const DB_SCHEMA_VERSION_KEY = "dbSchemaVersion"; export type DbMigrationReport = MigratedDbReport | NotMigratedDbReport; export interface MigratedDbReport { migrated: true; fromVersion: number; schemaVersion: number; } export interface NotMigratedDbReport { migrated: false; schemaVersion: number; } export declare function createOrOpenSqliteConnection(options: { sqliteFile: string; ddlFile: string; dbSchemaName: string; canCreate: boolean; logger: BasicAppLogger; knexLogger?: Knex.Logger; migrateDb: (cn: Knex) => Promise; ensureDependsOn?: { dependsOn: string; onMismatch: "error" | "reset"; }; inMemory?: boolean; }): Promise<{ cn: Knex; newDatabase: "created" | "reset" | false; migrationReport: DbMigrationReport; databaseId: string; }>; export declare function insertNewDatabaseMetadataValues(cn: Knex, options: { dbSchemaName: string; dependsOn?: string; }): Promise<{ databaseId: string; }>; export declare function generateDatabaseId(): string; export declare function executeDdl(cn: Knex, ddlFile: string, { dropAll }?: { dropAll?: boolean; }): Promise; export declare function dropAllUserTables(cn: Knex): Promise; export declare function getMetadataValue(cn: Knex, { dbSchemaName, key }: { dbSchemaName: string; key: string; }): Promise; export declare function setMetadataValue(cn: Knex, { dbSchemaName, key, value, errorIfMissing, }: { dbSchemaName: string; key: string; value: string; errorIfMissing?: boolean; }): Promise; export declare function getMetadataDbSchemaVersion(cn: Knex, { dbSchemaName }: { dbSchemaName: string; }): Promise; export declare function setMetadataDbSchemaVersion(cn: Knex, { dbSchemaName, value }: { dbSchemaName: string; value: number; }): Promise; //# sourceMappingURL=sqlite-db-init.d.ts.map