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