-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-prisma.js
More file actions
32 lines (24 loc) · 859 Bytes
/
test-prisma.js
File metadata and controls
32 lines (24 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const { PrismaClient } = require('@prisma/client');
const prisma = new PrismaClient({
log: ['query', 'info', 'warn', 'error'],
});
async function main() {
try {
console.log('Attempting to connect to database...');
await prisma.$connect();
console.log('Successfully connected to database');
const userCount = await prisma.user.count();
console.log('User count:', userCount);
const supportGroupCount = await prisma.supportGroup.count();
console.log('Support group count:', supportGroupCount);
const sessionCount = await prisma.session.count();
console.log('Session count:', sessionCount);
const activityCount = await prisma.activity.count();
console.log('Activity count:', activityCount);
} catch (error) {
console.error('Error:', error);
} finally {
await prisma.$disconnect();
}
}
main();