/* eslint-disable no-console */
import { PrismaClient } from '../../generated/client/index.js';
export const prismaClient = initPrismaClient();
function initPrismaClient() {
    const prisma = new PrismaClient();
    prisma
        .$connect()
        .then(() => {
        console.log('Successfully connected to database');
        // console.log('Database URL:', process.env.DATABASE_URL); // debug only
    })
        .catch((e) => {
        console.error('Failed to connect to database');
        // console.error('Database URL:', process.env.DATABASE_URL); // debug only
        console.error('Error:', e);
    });
    return prisma;
}
