File size: 563 Bytes
fb14972 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import { PrismaClient } from '@prisma/client';
async function testConnection() {
console.log('🔄 Testing database connection...');
try {
const prisma = new PrismaClient();
await prisma.$connect();
// Test query
const userCount = await prisma.user.count();
console.log(`✅ Database connection successful! Found ${userCount} users.`);
await prisma.$disconnect();
} catch (error) {
console.error('❌ Database connection failed:', error);
process.exit(1);
}
}
testConnection(); |