27 lines
741 B
TypeScript
27 lines
741 B
TypeScript
|
|
import { ConnectionTestResult, TableInfo } from '../types/externalDbTypes';
|
||
|
|
|
||
|
|
export interface ConnectionConfig {
|
||
|
|
host: string;
|
||
|
|
port: number;
|
||
|
|
database: string;
|
||
|
|
user: string;
|
||
|
|
password: string;
|
||
|
|
connectionTimeoutMillis?: number;
|
||
|
|
queryTimeoutMillis?: number;
|
||
|
|
ssl?: boolean | { rejectUnauthorized: boolean };
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface QueryResult {
|
||
|
|
rows: any[];
|
||
|
|
rowCount?: number;
|
||
|
|
fields?: any[];
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface DatabaseConnector {
|
||
|
|
connect(): Promise<void>;
|
||
|
|
disconnect(): Promise<void>;
|
||
|
|
testConnection(): Promise<ConnectionTestResult>;
|
||
|
|
executeQuery(query: string): Promise<QueryResult>;
|
||
|
|
getTables(): Promise<TableInfo[]>;
|
||
|
|
getColumns(tableName: string): Promise<any[]>; // 특정 테이블의 컬럼 정보 조회
|
||
|
|
}
|