import { SqliteConnection } from "../connection.js"; import { Migration } from "./registry.js"; //#region src/migrations/runner.d.ts /** * Result row of the `schema_migrations` bookkeeping table - one row per * applied migration. * * @stable */ interface AppliedMigration { readonly version: string; readonly name: string; readonly appliedAt: number; readonly checksum: string; } /** * Tuning knobs for {@link runMigrations}. Only `upTo` exists so * far and it is test-only. * * @internal */ interface RunMigrationsOptions { /** * Stop after this version (inclusive) - later migrations stay * pending. Test-only: lets a suite build a database frozen at a * historical schema and then exercise the upgrade path across a * specific migration. Not for production use; a partially-migrated * database is not a supported runtime state. * * @internal */ readonly upTo?: string; } /** * Apply every pending migration in version order. Each migration runs * inside its own transaction so a failure mid-sequence leaves the * database in a known-good state. Re-running `runMigrations` on a * fully-migrated DB is a no-op. * * @stable */ declare function runMigrations(conn: SqliteConnection, options?: RunMigrationsOptions): readonly AppliedMigration[]; /** * The migrations bundled with this build that are NOT recorded as * applied in the supplied database. Read-only: when the * `schema_migrations` table does not exist yet (a database this code * never touched), every bundled migration is pending and the foreign * file is NOT marked by creating the table. * * @stable */ declare function pendingMigrations(conn: SqliteConnection): readonly Migration[]; /** * Snapshot of every migration ever applied to this database. * * @stable */ declare function listAppliedMigrations(conn: SqliteConnection): readonly AppliedMigration[]; //#endregion export { AppliedMigration, RunMigrationsOptions, listAppliedMigrations, pendingMigrations, runMigrations }; //# sourceMappingURL=runner.d.ts.map