Files
moyosapp_beta.0.0.3.3_beta1/check-counts.ts

26 lines
723 B
TypeScript

import { prisma } from "@/lib/db";
async function main() {
console.log('Checking database counts...');
try {
const total = await prisma.guest.count();
const confirmed = await prisma.guest.count({
where: {
OR: [
{ rsvpStatus: 'ACCEPTED' },
{ AND: [{ rsvpStatus: 'PENDING' }, { isAttending: true }] }
]
}
});
console.log(`Total Guests: ${total}`);
console.log(`Confirmed Guests: ${confirmed}`);
} catch (error) {
console.error('Error querying database:', error);
}
}
main()
.catch(e => console.error(e))
.finally(async () => await prisma.$disconnect());