ui, 외부커넥션에서 쿼리 조회만 가능하도록

This commit is contained in:
leeheejin
2025-09-30 10:30:05 +09:00
parent 9168ab9a41
commit 8c19d57ced
24 changed files with 452 additions and 225 deletions

View File

@@ -91,7 +91,7 @@ async function executeMainDatabaseAction(
}
/**
* 외부 데이터베이스에서 데이터 액션 실행
* 외부 데이터베이스에서 데이터 액션 실행 (보안상 비활성화)
*/
async function executeExternalDatabaseAction(
tableName: string,
@@ -99,29 +99,8 @@ async function executeExternalDatabaseAction(
actionType: string,
connection: any
): Promise<any> {
try {
logger.info(`외부 DB 액션 실행: ${connection.name} (${connection.host}:${connection.port})`);
logger.info(`테이블: ${tableName}, 액션: ${actionType}`, data);
// 🔥 실제 외부 DB 연결 및 실행 로직 구현
const { MultiConnectionQueryService } = await import('../services/multiConnectionQueryService');
const queryService = new MultiConnectionQueryService();
let result;
switch (actionType.toLowerCase()) {
case 'insert':
result = await queryService.insertDataToConnection(connection.id, tableName, data);
logger.info(`외부 DB INSERT 성공:`, result);
break;
case 'update':
// TODO: UPDATE 로직 구현 (조건 필요)
throw new Error('UPDATE 액션은 아직 지원되지 않습니다. 조건 설정이 필요합니다.');
case 'delete':
// TODO: DELETE 로직 구현 (조건 필요)
throw new Error('DELETE 액션은 아직 지원되지 않습니다. 조건 설정이 필요합니다.');
default:
throw new Error(`지원하지 않는 액션 타입: ${actionType}`);
}
// 보안상 외부 DB에 대한 모든 데이터 변경 작업은 비활성화
throw new Error(`보안상 외부 데이터베이스에 대한 ${actionType.toUpperCase()} 작업은 허용되지 않습니다. SELECT 쿼리만 사용해주세요.`);
return {
success: true,