summaryrefslogtreecommitdiff
path: root/lib/oracle-db/db.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oracle-db/db.ts')
-rw-r--r--lib/oracle-db/db.ts39
1 files changed, 2 insertions, 37 deletions
diff --git a/lib/oracle-db/db.ts b/lib/oracle-db/db.ts
index 62321df0..211fd04b 100644
--- a/lib/oracle-db/db.ts
+++ b/lib/oracle-db/db.ts
@@ -1,3 +1,5 @@
+"use server";
+
import knex from 'knex';
// import oracledb from 'oracledb';
// eslint-disable-next-line @typescript-eslint/no-require-imports
@@ -30,40 +32,3 @@ export async function getOracleConnection() {
}
}
-// 연결을 테스트하는 함수
-export async function testOracleConnection() {
- try {
- const connection = await getOracleConnection();
- const result = await connection.execute('SELECT 1 FROM DUAL');
- await connection.close();
- return {
- success: true,
- message: 'Oracle DB 연결 성공',
- data: result.rows
- };
- } catch (error: unknown) {
- return {
- success: false,
- message: 'Oracle DB 연결 실패',
- error: error instanceof Error ? error.message : '알 수 없는 오류'
- };
- }
-}
-
-// Knex를 사용하여 Oracle 연결 테스트
-export async function testKnexOracleConnection() {
- try {
- const result = await oracleKnex.raw('SELECT 1 FROM DUAL');
- return {
- success: true,
- message: 'Knex Oracle DB 연결 성공',
- data: result
- };
- } catch (error: unknown) {
- return {
- success: false,
- message: 'Knex Oracle DB 연결 실패',
- error: error instanceof Error ? error.message : '알 수 없는 오류'
- };
- }
-} \ No newline at end of file