격자에 맞게 컴포넌트 배치
This commit is contained in:
@@ -205,7 +205,7 @@ export class ScreenManagementService {
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* 테이블 목록 조회
|
||||
* 테이블 목록 조회 (모든 테이블)
|
||||
*/
|
||||
async getTables(companyCode: string): Promise<TableInfo[]> {
|
||||
try {
|
||||
@@ -242,6 +242,54 @@ export class ScreenManagementService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 특정 테이블 정보 조회 (최적화된 단일 테이블 조회)
|
||||
*/
|
||||
async getTableInfo(
|
||||
tableName: string,
|
||||
companyCode: string
|
||||
): Promise<TableInfo | null> {
|
||||
try {
|
||||
console.log(`=== 단일 테이블 조회 시작: ${tableName} ===`);
|
||||
|
||||
// 테이블 존재 여부 확인
|
||||
const tableExists = await prisma.$queryRaw<Array<{ table_name: string }>>`
|
||||
SELECT table_name
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'public'
|
||||
AND table_type = 'BASE TABLE'
|
||||
AND table_name = ${tableName}
|
||||
`;
|
||||
|
||||
if (tableExists.length === 0) {
|
||||
console.log(`테이블 ${tableName}이 존재하지 않습니다.`);
|
||||
return null;
|
||||
}
|
||||
|
||||
// 해당 테이블의 컬럼 정보 조회
|
||||
const columns = await this.getTableColumns(tableName, companyCode);
|
||||
|
||||
if (columns.length === 0) {
|
||||
console.log(`테이블 ${tableName}의 컬럼 정보가 없습니다.`);
|
||||
return null;
|
||||
}
|
||||
|
||||
const tableInfo: TableInfo = {
|
||||
tableName: tableName,
|
||||
tableLabel: this.getTableLabel(tableName),
|
||||
columns: columns,
|
||||
};
|
||||
|
||||
console.log(
|
||||
`단일 테이블 조회 완료: ${tableName}, 컬럼 ${columns.length}개`
|
||||
);
|
||||
return tableInfo;
|
||||
} catch (error) {
|
||||
console.error(`테이블 ${tableName} 조회 실패:`, error);
|
||||
throw new Error(`테이블 ${tableName} 정보를 조회할 수 없습니다.`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 테이블 컬럼 정보 조회
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user