Merge branch 'main' into feature/screen-management
This commit is contained in:
320
backend-node/src/services/dbTypeCategoryService.ts
Normal file
320
backend-node/src/services/dbTypeCategoryService.ts
Normal file
@@ -0,0 +1,320 @@
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
export interface DbTypeCategory {
|
||||
type_code: string;
|
||||
display_name: string;
|
||||
icon?: string | null;
|
||||
color?: string | null;
|
||||
sort_order?: number | null;
|
||||
is_active: boolean;
|
||||
created_at: Date;
|
||||
updated_at: Date;
|
||||
}
|
||||
|
||||
export interface CreateDbTypeCategoryRequest {
|
||||
type_code: string;
|
||||
display_name: string;
|
||||
icon?: string;
|
||||
color?: string;
|
||||
sort_order?: number;
|
||||
}
|
||||
|
||||
export interface UpdateDbTypeCategoryRequest {
|
||||
display_name?: string;
|
||||
icon?: string;
|
||||
color?: string;
|
||||
sort_order?: number;
|
||||
is_active?: boolean;
|
||||
}
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
success: boolean;
|
||||
data?: T;
|
||||
message: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export class DbTypeCategoryService {
|
||||
/**
|
||||
* 모든 DB 타입 카테고리 조회
|
||||
*/
|
||||
static async getAllCategories(): Promise<ApiResponse<DbTypeCategory[]>> {
|
||||
try {
|
||||
const categories = await prisma.db_type_categories.findMany({
|
||||
where: { is_active: true },
|
||||
orderBy: [
|
||||
{ sort_order: 'asc' },
|
||||
{ display_name: 'asc' }
|
||||
]
|
||||
});
|
||||
|
||||
return {
|
||||
success: true,
|
||||
data: categories,
|
||||
message: "DB 타입 카테고리 목록을 조회했습니다."
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("DB 타입 카테고리 조회 오류:", error);
|
||||
return {
|
||||
success: false,
|
||||
message: "DB 타입 카테고리 조회 중 오류가 발생했습니다.",
|
||||
error: error instanceof Error ? error.message : "알 수 없는 오류"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 특정 DB 타입 카테고리 조회
|
||||
*/
|
||||
static async getCategoryByTypeCode(typeCode: string): Promise<ApiResponse<DbTypeCategory>> {
|
||||
try {
|
||||
const category = await prisma.db_type_categories.findUnique({
|
||||
where: { type_code: typeCode }
|
||||
});
|
||||
|
||||
if (!category) {
|
||||
return {
|
||||
success: false,
|
||||
message: "해당 DB 타입 카테고리를 찾을 수 없습니다."
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
data: category,
|
||||
message: "DB 타입 카테고리를 조회했습니다."
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("DB 타입 카테고리 조회 오류:", error);
|
||||
return {
|
||||
success: false,
|
||||
message: "DB 타입 카테고리 조회 중 오류가 발생했습니다.",
|
||||
error: error instanceof Error ? error.message : "알 수 없는 오류"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DB 타입 카테고리 생성
|
||||
*/
|
||||
static async createCategory(data: CreateDbTypeCategoryRequest): Promise<ApiResponse<DbTypeCategory>> {
|
||||
try {
|
||||
// 중복 체크
|
||||
const existing = await prisma.db_type_categories.findUnique({
|
||||
where: { type_code: data.type_code }
|
||||
});
|
||||
|
||||
if (existing) {
|
||||
return {
|
||||
success: false,
|
||||
message: "이미 존재하는 DB 타입 코드입니다."
|
||||
};
|
||||
}
|
||||
|
||||
const category = await prisma.db_type_categories.create({
|
||||
data: {
|
||||
type_code: data.type_code,
|
||||
display_name: data.display_name,
|
||||
icon: data.icon,
|
||||
color: data.color,
|
||||
sort_order: data.sort_order || 0
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
success: true,
|
||||
data: category,
|
||||
message: "DB 타입 카테고리가 생성되었습니다."
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("DB 타입 카테고리 생성 오류:", error);
|
||||
return {
|
||||
success: false,
|
||||
message: "DB 타입 카테고리 생성 중 오류가 발생했습니다.",
|
||||
error: error instanceof Error ? error.message : "알 수 없는 오류"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DB 타입 카테고리 수정
|
||||
*/
|
||||
static async updateCategory(typeCode: string, data: UpdateDbTypeCategoryRequest): Promise<ApiResponse<DbTypeCategory>> {
|
||||
try {
|
||||
const category = await prisma.db_type_categories.update({
|
||||
where: { type_code: typeCode },
|
||||
data: {
|
||||
display_name: data.display_name,
|
||||
icon: data.icon,
|
||||
color: data.color,
|
||||
sort_order: data.sort_order,
|
||||
is_active: data.is_active,
|
||||
updated_at: new Date()
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
success: true,
|
||||
data: category,
|
||||
message: "DB 타입 카테고리가 수정되었습니다."
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("DB 타입 카테고리 수정 오류:", error);
|
||||
return {
|
||||
success: false,
|
||||
message: "DB 타입 카테고리 수정 중 오류가 발생했습니다.",
|
||||
error: error instanceof Error ? error.message : "알 수 없는 오류"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DB 타입 카테고리 삭제 (비활성화)
|
||||
*/
|
||||
static async deleteCategory(typeCode: string): Promise<ApiResponse<void>> {
|
||||
try {
|
||||
// 해당 타입을 사용하는 연결이 있는지 확인
|
||||
const connectionsCount = await prisma.external_db_connections.count({
|
||||
where: {
|
||||
db_type: typeCode,
|
||||
is_active: "Y"
|
||||
}
|
||||
});
|
||||
|
||||
if (connectionsCount > 0) {
|
||||
return {
|
||||
success: false,
|
||||
message: `해당 DB 타입을 사용하는 연결이 ${connectionsCount}개 있어 삭제할 수 없습니다.`
|
||||
};
|
||||
}
|
||||
|
||||
await prisma.db_type_categories.update({
|
||||
where: { type_code: typeCode },
|
||||
data: {
|
||||
is_active: false,
|
||||
updated_at: new Date()
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
success: true,
|
||||
message: "DB 타입 카테고리가 삭제되었습니다."
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("DB 타입 카테고리 삭제 오류:", error);
|
||||
return {
|
||||
success: false,
|
||||
message: "DB 타입 카테고리 삭제 중 오류가 발생했습니다.",
|
||||
error: error instanceof Error ? error.message : "알 수 없는 오류"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DB 타입별 연결 통계 조회
|
||||
*/
|
||||
static async getConnectionStatsByType(): Promise<ApiResponse<any[]>> {
|
||||
try {
|
||||
const stats = await prisma.external_db_connections.groupBy({
|
||||
by: ['db_type'],
|
||||
where: { is_active: "Y" },
|
||||
_count: {
|
||||
id: true
|
||||
}
|
||||
});
|
||||
|
||||
// 카테고리 정보와 함께 반환
|
||||
const categories = await prisma.db_type_categories.findMany({
|
||||
where: { is_active: true }
|
||||
});
|
||||
|
||||
const result = categories.map(category => {
|
||||
const stat = stats.find(s => s.db_type === category.type_code);
|
||||
return {
|
||||
...category,
|
||||
connection_count: stat?._count.id || 0
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
success: true,
|
||||
data: result,
|
||||
message: "DB 타입별 연결 통계를 조회했습니다."
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("DB 타입별 통계 조회 오류:", error);
|
||||
return {
|
||||
success: false,
|
||||
message: "DB 타입별 통계 조회 중 오류가 발생했습니다.",
|
||||
error: error instanceof Error ? error.message : "알 수 없는 오류"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 기본 DB 타입 카테고리 초기화
|
||||
*/
|
||||
static async initializeDefaultCategories(): Promise<ApiResponse<void>> {
|
||||
try {
|
||||
const defaultCategories = [
|
||||
{
|
||||
type_code: 'postgresql',
|
||||
display_name: 'PostgreSQL',
|
||||
icon: 'postgresql',
|
||||
color: '#336791',
|
||||
sort_order: 1
|
||||
},
|
||||
{
|
||||
type_code: 'oracle',
|
||||
display_name: 'Oracle',
|
||||
icon: 'oracle',
|
||||
color: '#F80000',
|
||||
sort_order: 2
|
||||
},
|
||||
{
|
||||
type_code: 'mysql',
|
||||
display_name: 'MySQL',
|
||||
icon: 'mysql',
|
||||
color: '#4479A1',
|
||||
sort_order: 3
|
||||
},
|
||||
{
|
||||
type_code: 'mariadb',
|
||||
display_name: 'MariaDB',
|
||||
icon: 'mariadb',
|
||||
color: '#003545',
|
||||
sort_order: 4
|
||||
},
|
||||
{
|
||||
type_code: 'mssql',
|
||||
display_name: 'SQL Server',
|
||||
icon: 'mssql',
|
||||
color: '#CC2927',
|
||||
sort_order: 5
|
||||
}
|
||||
];
|
||||
|
||||
for (const category of defaultCategories) {
|
||||
await prisma.db_type_categories.upsert({
|
||||
where: { type_code: category.type_code },
|
||||
update: {},
|
||||
create: category
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
message: "기본 DB 타입 카테고리가 초기화되었습니다."
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("기본 카테고리 초기화 오류:", error);
|
||||
return {
|
||||
success: false,
|
||||
message: "기본 카테고리 초기화 중 오류가 발생했습니다.",
|
||||
error: error instanceof Error ? error.message : "알 수 없는 오류"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
TableInfo,
|
||||
} from "../types/externalDbTypes";
|
||||
import { PasswordEncryption } from "../utils/passwordEncryption";
|
||||
import { DbConnectionManager } from "./dbConnectionManager";
|
||||
import { DatabaseConnectorFactory } from "../database/DatabaseConnectorFactory";
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
@@ -81,6 +81,93 @@ export class ExternalDbConnectionService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DB 타입별로 그룹화된 외부 DB 연결 목록 조회
|
||||
*/
|
||||
static async getConnectionsGroupedByType(
|
||||
filter: ExternalDbConnectionFilter = {}
|
||||
): Promise<ApiResponse<Record<string, ExternalDbConnection[]>>> {
|
||||
try {
|
||||
// 기본 연결 목록 조회
|
||||
const connectionsResult = await this.getConnections(filter);
|
||||
|
||||
if (!connectionsResult.success || !connectionsResult.data) {
|
||||
return {
|
||||
success: false,
|
||||
message: "연결 목록 조회에 실패했습니다."
|
||||
};
|
||||
}
|
||||
|
||||
// DB 타입 카테고리 정보 조회
|
||||
const categories = await prisma.db_type_categories.findMany({
|
||||
where: { is_active: true },
|
||||
orderBy: [
|
||||
{ sort_order: 'asc' },
|
||||
{ display_name: 'asc' }
|
||||
]
|
||||
});
|
||||
|
||||
// DB 타입별로 그룹화
|
||||
const groupedConnections: Record<string, any> = {};
|
||||
|
||||
// 카테고리 정보를 포함한 그룹 초기화
|
||||
categories.forEach((category: any) => {
|
||||
groupedConnections[category.type_code] = {
|
||||
category: {
|
||||
type_code: category.type_code,
|
||||
display_name: category.display_name,
|
||||
icon: category.icon,
|
||||
color: category.color,
|
||||
sort_order: category.sort_order
|
||||
},
|
||||
connections: []
|
||||
};
|
||||
});
|
||||
|
||||
// 연결을 해당 타입 그룹에 배치
|
||||
connectionsResult.data.forEach(connection => {
|
||||
if (groupedConnections[connection.db_type]) {
|
||||
groupedConnections[connection.db_type].connections.push(connection);
|
||||
} else {
|
||||
// 카테고리에 없는 DB 타입인 경우 기타 그룹에 추가
|
||||
if (!groupedConnections['other']) {
|
||||
groupedConnections['other'] = {
|
||||
category: {
|
||||
type_code: 'other',
|
||||
display_name: '기타',
|
||||
icon: 'database',
|
||||
color: '#6B7280',
|
||||
sort_order: 999
|
||||
},
|
||||
connections: []
|
||||
};
|
||||
}
|
||||
groupedConnections['other'].connections.push(connection);
|
||||
}
|
||||
});
|
||||
|
||||
// 연결이 없는 빈 그룹 제거
|
||||
Object.keys(groupedConnections).forEach(key => {
|
||||
if (groupedConnections[key].connections.length === 0) {
|
||||
delete groupedConnections[key];
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
success: true,
|
||||
data: groupedConnections,
|
||||
message: `DB 타입별로 그룹화된 연결 목록을 조회했습니다.`
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("그룹화된 연결 목록 조회 실패:", error);
|
||||
return {
|
||||
success: false,
|
||||
message: "그룹화된 연결 목록 조회 중 오류가 발생했습니다.",
|
||||
error: error instanceof Error ? error.message : "알 수 없는 오류"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 특정 외부 DB 연결 조회
|
||||
*/
|
||||
@@ -239,13 +326,40 @@ export class ExternalDbConnectionService {
|
||||
}
|
||||
}
|
||||
|
||||
// 비밀번호가 변경되는 경우, 연결 테스트 먼저 수행
|
||||
if (data.password && data.password !== "***ENCRYPTED***") {
|
||||
// 임시 연결 설정으로 테스트
|
||||
const testConfig = {
|
||||
host: data.host || existingConnection.host,
|
||||
port: data.port || existingConnection.port,
|
||||
database: data.database_name || existingConnection.database_name,
|
||||
user: data.username || existingConnection.username,
|
||||
password: data.password, // 새로 입력된 비밀번호로 테스트
|
||||
connectionTimeoutMillis: data.connection_timeout != null ? data.connection_timeout * 1000 : undefined,
|
||||
queryTimeoutMillis: data.query_timeout != null ? data.query_timeout * 1000 : undefined,
|
||||
ssl: (data.ssl_enabled || existingConnection.ssl_enabled) === "Y" ? { rejectUnauthorized: false } : false
|
||||
};
|
||||
|
||||
// 연결 테스트 수행
|
||||
const connector = await DatabaseConnectorFactory.createConnector(existingConnection.db_type, testConfig, id);
|
||||
const testResult = await connector.testConnection();
|
||||
|
||||
if (!testResult.success) {
|
||||
return {
|
||||
success: false,
|
||||
message: "새로운 연결 정보로 테스트에 실패했습니다. 수정할 수 없습니다.",
|
||||
error: testResult.error ? `${testResult.error.code}: ${testResult.error.details}` : undefined
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// 업데이트 데이터 준비
|
||||
const updateData: any = {
|
||||
...data,
|
||||
updated_date: new Date(),
|
||||
};
|
||||
|
||||
// 비밀번호가 변경된 경우 암호화
|
||||
// 비밀번호가 변경된 경우 암호화 (연결 테스트 통과 후)
|
||||
if (data.password && data.password !== "***ENCRYPTED***") {
|
||||
updateData.password = PasswordEncryption.encrypt(data.password);
|
||||
} else {
|
||||
@@ -320,7 +434,8 @@ export class ExternalDbConnectionService {
|
||||
* 데이터베이스 연결 테스트 (ID 기반)
|
||||
*/
|
||||
static async testConnectionById(
|
||||
id: number
|
||||
id: number,
|
||||
testData?: { password?: string }
|
||||
): Promise<import("../types/externalDbTypes").ConnectionTestResult> {
|
||||
try {
|
||||
// 저장된 연결 정보 조회
|
||||
@@ -339,9 +454,17 @@ export class ExternalDbConnectionService {
|
||||
};
|
||||
}
|
||||
|
||||
// 비밀번호 복호화
|
||||
const decryptedPassword = await this.getDecryptedPassword(id);
|
||||
if (!decryptedPassword) {
|
||||
// 비밀번호 결정 (테스트용 비밀번호가 제공된 경우 그것을 사용, 아니면 저장된 비밀번호 복호화)
|
||||
let password: string | null;
|
||||
if (testData?.password) {
|
||||
password = testData.password;
|
||||
console.log(`🔍 [연결테스트] 새로 입력된 비밀번호 사용: ${password.substring(0, 3)}***`);
|
||||
} else {
|
||||
password = await this.getDecryptedPassword(id);
|
||||
console.log(`🔍 [연결테스트] 저장된 비밀번호 사용: ${password ? password.substring(0, 3) + '***' : 'null'}`);
|
||||
}
|
||||
|
||||
if (!password) {
|
||||
return {
|
||||
success: false,
|
||||
message: "비밀번호 복호화에 실패했습니다.",
|
||||
@@ -358,14 +481,46 @@ export class ExternalDbConnectionService {
|
||||
port: connection.port,
|
||||
database: connection.database_name,
|
||||
user: connection.username,
|
||||
password: decryptedPassword,
|
||||
password: password,
|
||||
connectionTimeoutMillis: connection.connection_timeout != null ? connection.connection_timeout * 1000 : undefined,
|
||||
queryTimeoutMillis: connection.query_timeout != null ? connection.query_timeout * 1000 : undefined,
|
||||
ssl: connection.ssl_enabled === "Y" ? { rejectUnauthorized: false } : false
|
||||
};
|
||||
|
||||
// DbConnectionManager를 통한 연결 테스트
|
||||
return await DbConnectionManager.testConnection(id, connection.db_type, config);
|
||||
// 연결 테스트용 임시 커넥터 생성 (캐시 사용하지 않음)
|
||||
let connector: any;
|
||||
switch (connection.db_type.toLowerCase()) {
|
||||
case 'postgresql':
|
||||
const { PostgreSQLConnector } = await import('../database/PostgreSQLConnector');
|
||||
connector = new PostgreSQLConnector(config);
|
||||
break;
|
||||
case 'oracle':
|
||||
const { OracleConnector } = await import('../database/OracleConnector');
|
||||
connector = new OracleConnector(config);
|
||||
break;
|
||||
case 'mariadb':
|
||||
case 'mysql':
|
||||
const { MariaDBConnector } = await import('../database/MariaDBConnector');
|
||||
connector = new MariaDBConnector(config);
|
||||
break;
|
||||
case 'mssql':
|
||||
const { MSSQLConnector } = await import('../database/MSSQLConnector');
|
||||
connector = new MSSQLConnector(config);
|
||||
break;
|
||||
default:
|
||||
throw new Error(`지원하지 않는 데이터베이스 타입: ${connection.db_type}`);
|
||||
}
|
||||
|
||||
console.log(`🔍 [연결테스트] 새 커넥터로 DB 연결 시도 - Host: ${config.host}, DB: ${config.database}, User: ${config.user}`);
|
||||
|
||||
const testResult = await connector.testConnection();
|
||||
console.log(`🔍 [연결테스트] 결과 - Success: ${testResult.success}, Message: ${testResult.message}`);
|
||||
|
||||
return {
|
||||
success: testResult.success,
|
||||
message: testResult.message,
|
||||
details: testResult.details
|
||||
};
|
||||
} catch (error) {
|
||||
return {
|
||||
success: false,
|
||||
@@ -416,7 +571,7 @@ export class ExternalDbConnectionService {
|
||||
}
|
||||
|
||||
// DB 타입 유효성 검사
|
||||
const validDbTypes = ["mysql", "postgresql", "oracle", "mssql", "sqlite"];
|
||||
const validDbTypes = ["mysql", "postgresql", "oracle", "mssql", "sqlite", "mariadb"];
|
||||
if (!validDbTypes.includes(data.db_type)) {
|
||||
throw new Error("지원하지 않는 DB 타입입니다.");
|
||||
}
|
||||
@@ -487,8 +642,9 @@ export class ExternalDbConnectionService {
|
||||
ssl: connection.ssl_enabled === "Y" ? { rejectUnauthorized: false } : false
|
||||
};
|
||||
|
||||
// DbConnectionManager를 통한 쿼리 실행
|
||||
const result = await DbConnectionManager.executeQuery(id, connection.db_type, config, query);
|
||||
// DatabaseConnectorFactory를 통한 쿼리 실행
|
||||
const connector = await DatabaseConnectorFactory.createConnector(connection.db_type, config, id);
|
||||
const result = await connector.executeQuery(query);
|
||||
|
||||
return {
|
||||
success: true,
|
||||
@@ -595,8 +751,9 @@ export class ExternalDbConnectionService {
|
||||
ssl: connection.ssl_enabled === "Y" ? { rejectUnauthorized: false } : false
|
||||
};
|
||||
|
||||
// DbConnectionManager를 통한 테이블 목록 조회
|
||||
const tables = await DbConnectionManager.getTables(id, connection.db_type, config);
|
||||
// DatabaseConnectorFactory를 통한 테이블 목록 조회
|
||||
const connector = await DatabaseConnectorFactory.createConnector(connection.db_type, config, id);
|
||||
const tables = await connector.getTables();
|
||||
|
||||
return {
|
||||
success: true,
|
||||
@@ -676,4 +833,57 @@ export class ExternalDbConnectionService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 특정 테이블의 컬럼 정보 조회
|
||||
*/
|
||||
static async getTableColumns(connectionId: number, tableName: string): Promise<ApiResponse<any[]>> {
|
||||
let client: any = null;
|
||||
|
||||
try {
|
||||
const connection = await this.getConnectionById(connectionId);
|
||||
if (!connection.success || !connection.data) {
|
||||
return {
|
||||
success: false,
|
||||
message: "연결 정보를 찾을 수 없습니다."
|
||||
};
|
||||
}
|
||||
|
||||
const connectionData = connection.data;
|
||||
|
||||
// 비밀번호 복호화
|
||||
const decryptedPassword = PasswordEncryption.decrypt(connectionData.password);
|
||||
|
||||
// 연결 설정 준비
|
||||
const config = {
|
||||
host: connectionData.host,
|
||||
port: connectionData.port,
|
||||
database: connectionData.database_name,
|
||||
user: connectionData.username,
|
||||
password: decryptedPassword,
|
||||
connectionTimeoutMillis: connectionData.connection_timeout != null ? connectionData.connection_timeout * 1000 : undefined,
|
||||
queryTimeoutMillis: connectionData.query_timeout != null ? connectionData.query_timeout * 1000 : undefined,
|
||||
ssl: connectionData.ssl_enabled === "Y" ? { rejectUnauthorized: false } : false
|
||||
};
|
||||
|
||||
// 데이터베이스 타입에 따른 커넥터 생성
|
||||
const connector = await DatabaseConnectorFactory.createConnector(connectionData.db_type, config, connectionId);
|
||||
|
||||
// 컬럼 정보 조회
|
||||
const columns = await connector.getColumns(tableName);
|
||||
|
||||
return {
|
||||
success: true,
|
||||
data: columns,
|
||||
message: "컬럼 정보를 조회했습니다."
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("컬럼 정보 조회 오류:", error);
|
||||
return {
|
||||
success: false,
|
||||
message: "컬럼 정보 조회 중 오류가 발생했습니다.",
|
||||
error: error instanceof Error ? error.message : "알 수 없는 오류"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user