This commit is contained in:
austinkelsay 2024-10-28 15:19:49 -05:00
parent 523eaf5b6a
commit 10285a82e6
No known key found for this signature in database
GPG Key ID: 44CB4EC6D9F2FA02
2 changed files with 1 additions and 16 deletions

View File

@ -7,7 +7,6 @@ datasource db {
provider = "postgresql" provider = "postgresql"
url = env("POSTGRES_PRISMA_URL") url = env("POSTGRES_PRISMA_URL")
directUrl = env("POSTGRES_URL_NON_POOLING") directUrl = env("POSTGRES_URL_NON_POOLING")
relationMode = "prisma"
} }
generator client { generator client {

View File

@ -7,21 +7,7 @@ let prisma;
// If not, create a new instance of PrismaClient and attach it to the global object. // If not, create a new instance of PrismaClient and attach it to the global object.
// This ensures that the same instance of PrismaClient is reused across multiple invocations. // This ensures that the same instance of PrismaClient is reused across multiple invocations.
if (!global.prisma) { if (!global.prisma) {
global.prisma = new PrismaClient({ global.prisma = new PrismaClient();
datasources: {
db: {
url: process.env.POSTGRES_PRISMA_URL
}
},
// Add connection pool configuration
connection: {
pool: {
min: 0,
max: 1,
idleTimeoutMillis: 5000
}
}
});
} }
// Assign the global PrismaClient instance to the prisma variable. // Assign the global PrismaClient instance to the prisma variable.