/** * Smart Relation Detector * * Uses heuristics and schema analysis to detect relationships between tables: * - Explicit foreign keys (highest confidence) * - Junction tables for ManyToMany * - Unique FK columns for OneToOne */ import type { SchemaAST } from '../../schema/schemaAST.js'; import type { DetectedRelation } from '../../schema/types.js'; /** * Configuration for relation detection. */ export interface RelationDetectorOptions { /** Minimum confidence threshold (0-1) to include in results */ minConfidence?: number; /** Custom singularize function */ singularize?: (name: string) => string; } /** * Detects relationships in a SchemaAST using multiple heuristics. */ export declare class SmartRelationDetector { private readonly ast; private readonly options; constructor(ast: SchemaAST, options?: RelationDetectorOptions); /** * Detect all relationships in the schema. */ detectAll(): DetectedRelation[]; /** * Detect junction tables that represent ManyToMany relationships. */ private detectJunctionTables; /** * Detect relations where unique FK should upgrade to OneToOne. */ private detectOneToOneRelations; /** * Default singularize function (delegates to shared utility). */ private defaultSingularize; } /** * Create a SmartRelationDetector for the given AST. */ export declare function createRelationDetector(ast: SchemaAST, options?: RelationDetectorOptions): SmartRelationDetector; //# sourceMappingURL=smartRelationDetector.d.ts.map