UNPKG

code-auditor-mcp

Version:

Multi-language code quality auditor with MCP server - Analyze TypeScript, JavaScript, and Go code for SOLID principles, DRY violations, security patterns, and more

89 lines 2.35 kB
/** * Database Schema Parser and Validator * Handles loading, parsing, and validating database schema definitions */ import { SchemaDefinition, DatabaseSchema, SchemaViolation } from '../types.js'; export interface SchemaParseResult { success: boolean; schema?: SchemaDefinition; violations: SchemaViolation[]; errors: string[]; } export interface SchemaValidationOptions { checkReferences?: boolean; checkNamingConventions?: boolean; checkIndexes?: boolean; strictMode?: boolean; allowedDatabaseTypes?: string[]; } export declare class SchemaParser { private static readonly SUPPORTED_FORMATS; private static readonly DATABASE_TYPES; /** * Parse schema from file */ parseFromFile(filePath: string, options?: SchemaValidationOptions): Promise<SchemaParseResult>; /** * Parse schema from string content */ parseFromString(content: string, format: string, options?: SchemaValidationOptions): Promise<SchemaParseResult>; /** * Validate basic structure of parsed object */ private validateStructure; /** * Normalize parsed object to typed schema */ private normalizeSchema; /** * Normalize database object */ private normalizeDatabase; /** * Normalize table object */ private normalizeTable; /** * Normalize column object */ private normalizeColumn; /** * Validate schema content and relationships */ private validateSchema; /** * Validate individual database */ private validateDatabase; /** * Validate individual table */ private validateTable; /** * Validate column definitions */ private validateColumn; /** * Validate table naming conventions */ private validateTableNaming; /** * Validate references across tables */ private validateReferences; /** * Get schema statistics */ getSchemaStats(schema: SchemaDefinition): { databaseCount: number; tableCount: number; columnCount: number; referenceCount: number; indexCount: number; }; /** * Find circular dependencies in schema */ findCircularDependencies(database: DatabaseSchema): string[][]; } //# sourceMappingURL=SchemaParser.d.ts.map