forked from syntaxbullet/aurorabot
17 lines
409 B
TypeScript
17 lines
409 B
TypeScript
|
|
import postgres from "postgres";
|
|
|
|
const connectionString = "postgresql://auroradev:auroradev123@127.0.0.1:5432/aurora_test";
|
|
console.log("Connecting to:", connectionString);
|
|
|
|
const sql = postgres(connectionString);
|
|
|
|
try {
|
|
const result = await sql`SELECT 1 as val`;
|
|
console.log("Success:", result);
|
|
await sql.end();
|
|
} catch (e) {
|
|
console.error("Connection failed:", e);
|
|
await sql.end();
|
|
}
|