/** * @license * Copyright 2026 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { ITabularMigration, ITabularMigrationApplier, TabularMigrationProgressListener } from "./TabularMigration"; /** * Sequences pending tabular migrations through a backend's * {@link ITabularMigrationApplier}. * * Two paths: * - **fresh-DB fast path** — applied is empty AND the caller signaled (via * `freshTable: true`) that the underlying table/store did not exist * before this run, OR `applier.tableExists()` returns false. The * orchestrator records every declared migration as already-applied * without running its ops. * - **run-pending path** — sorted-by-version, skip already-applied, * call `applyMigration` for each remaining one. * * Bookkeeping is owned by the applier (one row per `(component, version)` * in the existing `_storage_migrations` table). * * The `freshTable` option exists because `setupDatabase()` typically creates * the table at the target schema *before* invoking the orchestrator, which * defeats the `tableExists()` probe (the store always looks "existing" by * the time the orchestrator runs). Callers should pass the freshness probe * they took *before* creating the table. */ export interface RunTabularMigrationsOptions { readonly onProgress?: TabularMigrationProgressListener; readonly freshTable?: boolean; } export declare function runTabularMigrations(applier: ITabularMigrationApplier, defaultComponent: string, migrations: ReadonlyArray, options?: RunTabularMigrationsOptions): Promise; //# sourceMappingURL=TabularMigrationOrchestrator.d.ts.map