@@ -29,9 +29,11 @@ function getPostgresSchema(connectionString) {
2929 * setup and connection-string schema handling inside this package.
3030 *
3131 * @param {string } connectionString PostgreSQL URL for the challenge database.
32- * @param {import('./generated').Prisma.PrismaClientOptions } [options] Optional
33- * Prisma logging, transaction, and omit settings. The factory owns `adapter`
34- * and `accelerateUrl`, so any JavaScript values supplied for them are ignored.
32+ * @param {import('./generated').Prisma.PrismaClientOptions &
33+ * {driverOptions?: import('pg').PoolConfig}} [options] Optional Prisma logging,
34+ * transaction, and omit settings plus PostgreSQL pool/timeout settings. The
35+ * factory owns `adapter`, `accelerateUrl`, and the driver connection string, so
36+ * JavaScript values supplied for them are ignored.
3537 * @returns {import('./generated').PrismaClient } A lazily connected challenge
3638 * Prisma client. The caller must invoke `$disconnect()` during shutdown.
3739 * @throws {TypeError } When `connectionString` is not a non-empty string.
@@ -43,13 +45,16 @@ function createChallengePrismaClient(connectionString, options = {}) {
4345 throw new TypeError ( 'Challenge database connection string is required' ) ;
4446 }
4547
46- const clientOptions = { ...options } ;
48+ const { driverOptions : suppliedDriverOptions = { } , ...clientOptions } =
49+ options ;
50+ const driverOptions = { ...suppliedDriverOptions } ;
4751 delete clientOptions . adapter ;
4852 delete clientOptions . accelerateUrl ;
53+ delete driverOptions . connectionString ;
4954
5055 const schema = getPostgresSchema ( connectionString ) ;
5156 const adapter = new PrismaPg (
52- { connectionString } ,
57+ { ... driverOptions , connectionString } ,
5358 schema ? { schema } : undefined ,
5459 ) ;
5560
0 commit comments