From 47ae7f8650f980a54e764a593c47d8bc74e91fb3 Mon Sep 17 00:00:00 2001 From: MythEclipse Date: Thu, 14 May 2026 16:25:45 +0700 Subject: [PATCH] chore: remove temporary test files --- list-databases.ts | 28 ---------------------------- test-pg-connection.ts | 26 -------------------------- 2 files changed, 54 deletions(-) delete mode 100644 list-databases.ts delete mode 100644 test-pg-connection.ts diff --git a/list-databases.ts b/list-databases.ts deleted file mode 100644 index 4dc0f54..0000000 --- a/list-databases.ts +++ /dev/null @@ -1,28 +0,0 @@ -import "dotenv/config"; -import { Pool } from "pg"; - -async function listDatabases() { - // Connect to default postgres database first - const pool = new Pool({ - host: "ep-long-glitter-ao3sjoyu-pooler.c-2.ap-southeast-1.aws.neon.tech", - port: 5432, - user: "neondb_owner", - password: "npg_2ziHMPwZCet9", - database: "postgres", - connectionTimeoutMillis: 10000, - ssl: { rejectUnauthorized: false }, - }); - - try { - const result = await pool.query("SELECT datname FROM pg_database WHERE datistemplate = false ORDER BY datname;"); - console.log("✅ Available databases:"); - result.rows.forEach((row: any) => { - console.log(` - ${row.datname}`); - }); - await pool.end(); - } catch (error) { - console.error("❌ Error:", error instanceof Error ? error.message : String(error)); - } -} - -listDatabases(); diff --git a/test-pg-connection.ts b/test-pg-connection.ts deleted file mode 100644 index 7ca122d..0000000 --- a/test-pg-connection.ts +++ /dev/null @@ -1,26 +0,0 @@ -import "dotenv/config"; -import { Pool } from "pg"; - -const connectionString = process.env.DATABASE_URL; -console.log("Testing connection to:", connectionString?.replace(/:[^:]*@/, ":***@")); - -async function testConnection() { - const pool = new Pool({ - connectionString, - connectionTimeoutMillis: 10000, - statement_timeout: 10000, - }); - - try { - const result = await pool.query("SELECT NOW()"); - console.log("✅ Connection successful!"); - console.log("✅ Query result:", result.rows[0]); - await pool.end(); - process.exit(0); - } catch (error) { - console.error("❌ Connection failed:", error instanceof Error ? error.message : String(error)); - process.exit(1); - } -} - -testConnection();