feat: Prisma 완전 제거 완료 🎉

최종 작업:

1. config/database.ts 삭제:
   - Prisma 기반 database.ts 완전 제거
   - 더 이상 사용되지 않는 파일

2. referenceCacheService.ts 전환 (3개):
   -  getTableRowCount: $queryRawUnsafe → query
   -  cacheReferenceTable: $queryRawUnsafe → query
   -  batchLookup: $queryRaw → query (ANY 연산자)

전체 완료:
-  모든 Prisma 호출 전환 완료
-  PrismaClient import 완전 제거 (에러핸들러 제외)
-  database.ts 삭제
-  Raw Query 기반 시스템으로 완전 전환

최종 진행률: 54/54 (100%) 🎉
This commit is contained in:
kjs
2025-10-01 14:44:49 +09:00
parent e444dd9d39
commit b5fe2117af
2 changed files with 20 additions and 69 deletions

View File

@@ -1,50 +0,0 @@
import { PrismaClient } from "@prisma/client";
import config from "./environment";
// Prisma 클라이언트 생성 함수
function createPrismaClient() {
return new PrismaClient({
datasources: {
db: {
url: config.databaseUrl,
},
},
log: config.debug ? ["query", "info", "warn", "error"] : ["error"],
});
}
// 단일 인스턴스 생성
const prisma = createPrismaClient();
// 데이터베이스 연결 테스트
async function testConnection() {
try {
await prisma.$connect();
} catch (error) {
console.error("❌ 데이터베이스 연결 실패:", error);
process.exit(1);
}
}
// 애플리케이션 종료 시 연결 해제
process.on("beforeExit", async () => {
await prisma.$disconnect();
});
process.on("SIGINT", async () => {
await prisma.$disconnect();
process.exit(0);
});
process.on("SIGTERM", async () => {
await prisma.$disconnect();
process.exit(0);
});
// 초기 연결 테스트 (개발 환경에서만)
if (config.nodeEnv === "development") {
testConnection();
}
// 기본 내보내기
export = prisma;