/** * Base database adapter interface for CodeSeeker * Supports both SQLite and PostgreSQL implementations */ import { Logger } from '../../utils/logger'; import { InitializationProgress, DetectedPattern, QuestionnaireResponse, AnalysisResult, SystemError, ProjectType, ProjectSize } from '../../core/types'; export interface DatabaseConfig { type: 'sqlite' | 'postgresql'; connectionString?: string; path?: string; host?: string; port?: number; database?: string; username?: string; password?: string; ssl?: boolean; } export interface Project { id: string; projectPath: string; projectName: string; projectType?: ProjectType; languages: string[]; frameworks: string[]; projectSize?: ProjectSize; domain?: string; totalFiles: number; totalLines: number; status: 'active' | 'archived' | 'analyzing'; metadata: Record; createdAt: Date; updatedAt: Date; } export interface ProjectPath { id: string; projectId: string; path: string; pathType: 'primary' | 'alias' | 'historical'; isActive: boolean; createdAt: Date; deactivatedAt?: Date; } export interface DatabaseStats { projects: number; initialization_progress: number; detected_patterns: number; questionnaire_responses: number; analysis_results: number; active_projects: number; } export declare abstract class DatabaseAdapter { protected logger: Logger; protected config: DatabaseConfig; constructor(config: DatabaseConfig, logger: Logger); abstract initialize(): Promise; abstract close(): Promise; abstract migrate(): Promise; abstract isHealthy(): Promise; abstract createProject(project: Omit): Promise; abstract getProject(projectPath: string): Promise; abstract getProjectById(id: string): Promise; abstract updateProject(id: string, updates: Partial): Promise; abstract deleteProject(id: string): Promise; abstract listProjects(status?: string, limit?: number, offset?: number): Promise; abstract addProjectPath(projectId: string, path: string, pathType: 'primary' | 'alias' | 'historical'): Promise; abstract updateProjectPath(projectId: string, oldPath: string, newPath: string): Promise; abstract deactivateProjectPath(projectId: string, path: string): Promise; abstract getProjectByAnyPath(path: string): Promise; abstract getProjectPaths(projectId: string): Promise; abstract saveInitializationProgress(progress: Omit): Promise; abstract getInitializationProgress(projectPath: string): Promise; abstract updateInitializationProgress(resumeToken: string, updates: Partial): Promise; abstract saveDetectedPattern(pattern: Omit): Promise; abstract getDetectedPatterns(projectPath: string, patternType?: string): Promise; abstract updatePatternStatus(id: string, status: 'detected' | 'validated' | 'rejected'): Promise; abstract saveQuestionnaireResponse(response: Omit): Promise; abstract getQuestionnaireResponses(projectPath: string, category?: string): Promise; abstract saveAnalysisResult(result: Omit): Promise; abstract getAnalysisResults(projectPath: string, analysisType?: string, fileHash?: string): Promise; abstract getSystemConfig(key: string): Promise; abstract setSystemConfig(key: string, value: any, projectId?: string): Promise; abstract getDatabaseStats(): Promise; abstract recordOperationMetrics(operation: string, projectId: string | null, durationMs: number, success: boolean, error?: string, metadata?: Record): Promise; abstract cleanupExpiredResumeStates(): Promise; abstract archiveOldAnalysisResults(olderThanDays: number): Promise; protected handleError(operation: string, error: any): SystemError; } //# sourceMappingURL=base.d.ts.map