/** * SchemaAST Differ * * Compares two SchemaAST instances and produces a detailed diff. * Used for: * - Migration generation (entity vs database) * - Drift detection (expected vs actual) * - Schema synchronization */ import type { SchemaAST } from './schemaAST.js'; import type { SchemaDiffResult } from './types.js'; /** * Options for schema diffing. */ export interface DiffOptions { /** Compare indexes */ compareIndexes?: boolean; /** Compare foreign keys/relationships */ compareRelationships?: boolean; /** Ignore case differences in names */ ignoreCase?: boolean; /** Tables to exclude from comparison */ excludeTables?: string[]; } /** * Compares two SchemaAST instances and produces a detailed diff. */ export declare class SchemaASTDiffer { /** * Compare two schemas and return the differences. * * @param source - The "expected" or "desired" schema (e.g., from entities) * @param target - The "actual" or "current" schema (e.g., from database) * @param options - Diff options * @returns Detailed diff result */ diff(source: SchemaAST, target: SchemaAST, options?: DiffOptions): SchemaDiffResult; /** * Compare two tables and return the differences. */ private diffTable; /** * Compare columns between two tables. */ private diffTableColumns; /** * Compare indexes between two tables. */ private diffTableIndexes; /** * Compare two columns and return the difference. */ private diffColumn; /** * Compare two indexes and return the difference. */ private diffIndex; /** * Compare relationships at the schema level. */ private diffRelationships; /** * Compare two relationships. */ private diffRelationship; /** * Generate a unique key for a relationship based on its structure. */ private getRelationshipKey; /** * Format a canonical type for display. */ private formatType; /** * Normalize default values for comparison. */ private normalizeDefault; } /** * Create a differ and run a comparison. * Convenience function for one-off comparisons. */ export declare function diffSchemas(source: SchemaAST, target: SchemaAST, options?: DiffOptions): SchemaDiffResult; //# sourceMappingURL=schemaASTDiffer.d.ts.map