export interface ApplyOptions { migrationsFolder: string; migrationsTable: string; connectionUrl: string; stripConcurrently?: boolean; /** * Rewrite `CREATE TABLE` to `CREATE UNLOGGED TABLE`. A test database is * dropped or rolled back and never needs crash durability, so skipping the * WAL for its tables is free speed with no semantic change. Issue #325. */ unloggedTables?: boolean; /** * Called after each migration file is applied and tracked. Replaying a stack * is the longest single step of test setup; without this it is one silent * await and a caller watching for progress sees none. Issue #380. */ onMigration?: (tag: string, index: number, total: number) => void; /** * Called when a no-transaction migration resumes a half-applied file, with * the statement it starts from (1-based) and how many the file holds. * Issue #378. */ onResume?: (tag: string, fromStatement: number, total: number) => void; } export interface Migration { tag: string; hash: string; folderMillis: number; statements: string[]; noTransaction: boolean; } export declare function applyMigrations(options: ApplyOptions): Promise; export declare function readMigrations(options: ApplyOptions): Migration[]; /** * Split migration SQL into individual statements, honoring drizzle's * `--> statement-breakpoint` as an explicit separator. * * The scanning rules live in `statements.ts`, shared with the safety gate so * the runner and the gate cannot disagree about where a statement begins — * they did, and the gate was the one that was wrong (#334). */ export declare function parseStatements(raw: string): string[]; /** Companion to the tracker table, holding half-applied no-transaction files. */ export declare function progressTableName(migrationsTable: string): string; /** * The statement index a half-applied no-transaction file resumes from. Zero * when there is no record of one. * * A recorded partial whose hash no longer matches the file is refused rather * than resumed: the mark counts statements in the file as it was, and the file * on disk is now a different one, so no index into it means anything. */ export declare function resumePoint(migration: Migration, recorded: { hash: string; done: number; } | undefined, migrationsTable: string): number; /** * Rewrite every `CREATE TABLE` (including the `IF NOT EXISTS` form) to * `CREATE UNLOGGED TABLE`. Used only when applying schema to a test database — * a test database is dropped or rolled back, so the WAL its tables would * generate is pure overhead. `CREATE UNLOGGED TABLE` is otherwise identical * SQL: same columns, constraints, RLS, isolation. `TEMPORARY` and * already-`UNLOGGED` tables are left alone. Issue #325. */ export declare function makeTablesUnlogged(sql: string): string; //# sourceMappingURL=apply.d.ts.map