/** * Drift Detector * * Detects schema drift between expected schema (from entities) and * actual database schema. */ import type { SchemaAST } from '../../schema/schemaAST.js'; import type { DriftReport } from '../../schema/types.js'; import type { Dialect } from '../../type/index.js'; /** * Options for drift detection. */ export interface DriftDetectorOptions { /** Include column type mismatches */ checkTypes?: boolean; /** Include nullable mismatches */ checkNullable?: boolean; /** Include index differences */ checkIndexes?: boolean; /** Include foreign key differences */ checkForeignKeys?: boolean; /** Include default value differences */ checkDefaults?: boolean; /** SQL dialect for type formatting */ dialect?: Dialect; } /** * Detects drift between expected and actual database schemas. */ export declare class DriftDetector { private readonly expectedAST; private readonly actualAST; private readonly options; private readonly dialect; constructor(expectedAST: SchemaAST, actualAST: SchemaAST, options?: DriftDetectorOptions); /** * Detect all schema drift. */ detect(): DriftReport; /** * Detect table-level drifts (missing/unexpected tables). */ private detectTableDrifts; /** * Detect column-level drifts. */ private detectColumnDrifts; /** * Add drifts for column alterations (type/nullable mismatches). */ private addAlterColumnDrifts; /** * Detect index drifts. */ private detectIndexDrifts; /** * Detect relationship/FK drifts. */ private detectRelationshipDrifts; /** * Calculate overall status based on drifts. */ private calculateStatus; /** * Create a summary of drifts by severity. */ private createSummary; /** * Format type for display. */ private formatType; } /** * Create a DriftDetector for comparing expected vs actual schemas. */ export declare function createDriftDetector(expectedAST: SchemaAST, actualAST: SchemaAST, options?: DriftDetectorOptions): DriftDetector; /** * Quick check for schema drift. */ export declare function detectDrift(expectedAST: SchemaAST, actualAST: SchemaAST, options?: DriftDetectorOptions): DriftReport; //# sourceMappingURL=driftDetector.d.ts.map