import { extractExecutableStatements } from '@chkit/core'; export { extractExecutableStatements }; export interface DestructiveOperationMarker { migration: string; type: string; key: string; risk: string; warningCode: string; reason: string; impact: string; recommendation: string; summary: string; } export type MigrationOperationMode = 'sync' | 'async'; export interface MigrationOperationSummary { type: string; key: string; risk: string; mode: MigrationOperationMode; /** * SQL to run BEFORE re-attempting this operation, parsed from a * `-- before-retry: ` header line that follows the `-- operation:` * line. Empty / null on first attempt; runs on every retry. Compensates * for partial side effects left behind by a failed prior attempt * (e.g. TRUNCATE a partially-loaded table before re-INSERTing). */ beforeRetry: string | null; summary: string; } export declare function migrationContainsDangerOperation(sql: string): boolean; export declare function extractMigrationOperationSummaries(sql: string): MigrationOperationSummary[]; export declare function collectDestructiveOperationMarkers(migration: string, sql: string): DestructiveOperationMarker[]; export interface ScannedDestructiveStatement { type: string; statement: string; } /** * Scan the executable SQL (comments stripped) for destructive statements that * are NOT covered by a planner `-- operation:` marker. * * Generated migrations emit exactly one marker per statement, in order (the same * 1:1 invariant apply.ts relies on), so a marker-covered statement is governed * by the planner's risk classification and is trusted — e.g. a non-danger * `DROP MATERIALIZED VIEW` recreate. Only marker-less positions are flagged: a * fully hand-written migration (no markers) or a destructive statement * hand-appended to a generated one. */ export declare function scanDestructiveSqlStatements(sql: string): ScannedDestructiveStatement[]; export declare function migrationContainsDestructiveSql(sql: string): boolean; /** * Synthesize destructive-operation markers for migrations that contain * destructive SQL but carry no `-- operation: risk=danger` marker (hand-written * migrations). Used as a fallback so these still require --allow-destructive. */ export declare function collectUnmarkedDestructiveStatements(migration: string, sql: string): DestructiveOperationMarker[]; //# sourceMappingURL=safety-markers.d.ts.map