Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped
29 lines
872 B
Plaintext
29 lines
872 B
Plaintext
// Hand-maintained declaration for lib/migrate.js (sqlite3.migrate). The
|
|
// runner itself is JSDoc-documented in the implementation file.
|
|
|
|
import type { Database } from './native.js';
|
|
|
|
/**
|
|
* One migration: a name, and either a SQL script or a programmatic body.
|
|
*/
|
|
export interface Migration {
|
|
/** The migration's name (for errors and reporting). */
|
|
name: string;
|
|
/** The SQL script (or use `up`). */
|
|
sql?: string;
|
|
/** A programmatic body; receives the transaction connection. */
|
|
up?(tx: Database): unknown;
|
|
}
|
|
|
|
/**
|
|
* Runs every pending migration against the connection, in order, each in
|
|
* one transaction with `PRAGMA user_version` tracking the position.
|
|
* Idempotent.
|
|
*
|
|
* @since 9.1.0
|
|
*/
|
|
export declare function migrate(
|
|
db: Database,
|
|
migrations: string | Migration[],
|
|
): Promise<{ applied: string[]; from: number; to: number }>;
|