2025-05-19 14:36:29 +01:00
|
|
|
import { PrismaClient } from "@prismaclient";
|
2025-03-03 14:52:15 +00:00
|
|
|
|
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
|
|
|
|
|
|
async function testConnection() {
|
|
|
|
|
try {
|
|
|
|
|
// Perform a basic database query to test the connection
|
|
|
|
|
await prisma.$connect();
|
|
|
|
|
console.log("Database connection successful!");
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error("Failed to connect to the database:", error);
|
|
|
|
|
} finally {
|
|
|
|
|
await prisma.$disconnect();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
testConnection();
|