2024-07-16 13:41:44 -05:00
|
|
|
import createPrisma from '@/lib/create-prisma'
|
2021-03-25 14:29:24 -05:00
|
|
|
|
2022-04-27 17:06:42 -05:00
|
|
|
const prisma = global.prisma || (() => {
|
|
|
|
console.log('initing prisma')
|
2024-07-16 13:41:44 -05:00
|
|
|
return createPrisma({
|
|
|
|
connectionParams: {
|
|
|
|
connection_limit: process.env.DB_APP_CONNECTION_LIMIT
|
2022-03-31 13:05:11 -05:00
|
|
|
}
|
|
|
|
})
|
2022-04-27 17:06:42 -05:00
|
|
|
})()
|
2021-03-25 14:29:24 -05:00
|
|
|
|
2022-04-27 17:06:42 -05:00
|
|
|
if (process.env.NODE_ENV === 'development') global.prisma = prisma
|
|
|
|
|
|
|
|
export default prisma
|