/** * Migration Sandbox * * The core migration testing engine. Uses PGlite (in-process Postgres) to: * 1. Establish a baseline schema from the previous snapshot * 2. Compute the diff against the current schema * 3. Generate and test migration SQL locally * * This validates migrations before anything touches a remote database. */ import { EntityGeneratorInput } from "./entity-generator"; /** * Result of a migration sandbox run. */ export interface MigrationResult { /** Whether the migration was needed (schema changed) */ needed: boolean; /** Whether the migration executed without errors */ success: boolean; /** Generated SQL statements (up direction) */ upSql: string[]; /** Generated SQL statements (down direction) */ downSql: string[]; /** Error message if migration failed */ error?: string; } /** * Run the migration sandbox: detect changes, generate SQL, test execution. * * Uses PGlite's singleton pattern: all DataSources within a single * runMigrationSandbox call share the same in-process Postgres instance. * We reset the singleton at the start of each run for isolation. */ export declare function runMigrationSandbox(current: EntityGeneratorInput, projectDir?: string): Promise; /** * Apply a successful migration: update the snapshot to current state. */ export declare function applyMigration(current: EntityGeneratorInput, projectDir?: string): void; /** * Reset the sandbox: remove snapshot and PGlite data. */ export declare function resetSandbox(projectDir?: string): void;