import { type Knex } from "knex"; import { type CacheManager } from "../cache/types"; import { type EntityManager } from "../entity/entity-manager"; export type DataExplorerStrategy = "sample" | "ids" | "query" | "file" | "recent" | "random"; /** WHERE 조건 타입 (객체 또는 Knex QueryBuilder 함수) */ export type WhereCondition = Record | ((queryBuilder: Knex.QueryBuilder) => void); export type DataExplorerOptions = { strategy: DataExplorerStrategy; limit?: number; where?: WhereCondition; orderBy?: string; ids?: number[]; filePath?: string; /** 캐싱 사용 여부 (기본값: false) */ useCache?: boolean; /** 캐시 TTL (초 단위, 기본값: 300) */ cacheTtl?: number; }; export type ExploreWithRelationsOptions = DataExplorerOptions & { /** 관련 데이터 포함 여부 (기본값: true) */ includeRelations?: boolean; /** 재귀 탐색 최대 깊이 (기본값: 2) */ maxDepth?: number; }; export type ExploreWithRelationsResult = { /** 메인 entity 데이터 */ main: { entityId: string; records: Record[]; }; /** 관련 entity 데이터 (entityId -> records) */ related: Map[]>; }; export declare class DataExplorer { private db; private entityManager; private cache?; constructor(db: Knex, entityManager: typeof EntityManager, cacheManager?: CacheManager); explore(entityName: string, options: DataExplorerOptions): Promise[]>; private exploreInternal; private sampleData; private randomSample; private findTimestampColumn; private loadFromFile; exploreRelation(entityName: string, relationProp: string, options?: Partial): Promise[]>; /** * 여러 relation을 병렬로 조회합니다 (N+1 문제 해결) */ exploreRelations(entityName: string, relationProps: string[], options?: Partial): Promise[]>>; private generateCacheKey; /** * Entity와 관련된 데이터를 재귀적으로 탐색합니다. * BelongsToOne, OneToOne(hasJoinColumn) relation을 따라가며 참조 데이터를 수집합니다. */ exploreWithRelations(entityName: string, options: ExploreWithRelationsOptions): Promise; /** * 관련 데이터를 재귀적으로 수집합니다 (private helper) */ private collectRelatedData; } //# sourceMappingURL=data-explorer.d.ts.map