import { AlterTableStatement, CreateIndexStatement, CreateTableQuery } from 'rawsql-ts'; import { TableNameResolver } from './TableNameResolver'; /** * Controls how DDL lint findings are surfaced during fixture loading. */ export type DdlLintMode = 'strict' | 'warn' | 'off'; /** * Severity levels reported by the DDL integrity checker. */ export type DdlLintSeverity = 'error' | 'warning'; /** * Represents a single SQL source used for DDL linting. */ export interface DdlLintSource { /** Workspace-relative path to the SQL file being linted. */ path: string; /** Raw SQL contents for the file. */ sql: string; } /** * Machine-friendly diagnostic information for DDL integrity checks. */ export interface DdlLintDiagnostic { code: string; severity: DdlLintSeverity; source: string; statementIndex: number; message: string; table?: string; column?: string; constraint?: string; referencedTable?: string; referencedColumn?: string; } /** * Options to control DDL linting behavior and name resolution. */ export interface DdlLintOptions { tableNameResolver?: TableNameResolver; } /** * Parsed DDL statements grouped by kind, plus the diagnostics computed from them. */ export interface DdlSourceAnalysis { createStatements: Array<{ ast: CreateTableQuery; context: StatementContext; }>; alterStatements: Array<{ ast: AlterTableStatement; context: StatementContext; }>; indexStatements: Array<{ ast: CreateIndexStatement; context: StatementContext; }>; diagnostics: DdlLintDiagnostic[]; } /** * Default lint mode used when none is specified. */ export declare const DEFAULT_DDL_LINT_MODE: DdlLintMode; /** * Normalizes the requested lint mode, falling back to the default. */ export declare function normalizeDdlLintMode(mode?: DdlLintMode | null): DdlLintMode; type StatementContext = { source: string; statementIndex: number; }; /** * Runs integrity checks across the supplied DDL sources and returns sorted diagnostics. */ export declare function lintDdlSources(sources: DdlLintSource[], options?: DdlLintOptions): DdlLintDiagnostic[]; /** * Parses and analyzes DDL sources once so linting and metadata consumers can reuse the same statement stream. */ export declare function analyzeDdlSources(sources: DdlLintSource[], options?: DdlLintOptions): DdlSourceAnalysis; /** * Adjusts diagnostic severities based on the selected lint mode. */ export declare function applyDdlLintMode(diagnostics: DdlLintDiagnostic[], mode: DdlLintMode): DdlLintDiagnostic[]; /** * Formats DDL diagnostics into a human-readable summary. */ export declare function formatDdlLintDiagnostics(diagnostics: DdlLintDiagnostic[]): string; export {};