Skip to content

Commit

Permalink
feat(adapter-d1): set maxBindValues: 100
Browse files Browse the repository at this point in the history
  • Loading branch information
jkomyno committed May 20, 2024
1 parent 02deb42 commit fe2ab35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/adapter-d1/src/d1.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { D1Database, D1Response } from '@cloudflare/workers-types'
import {
ConnectionInfo,
Debug,
DriverAdapter,
err,
Expand Down Expand Up @@ -152,13 +153,19 @@ export class PrismaD1 extends D1Queryable<StdClient> implements DriverAdapter {
* await prisma.$transaction([ ...moreQueries ])
* ```
*/
warnOnce = (key: string, message: string, ...args: unknown[]) => {
private warnOnce = (key: string, message: string, ...args: unknown[]) => {
if (!this.alreadyWarned.has(key)) {
this.alreadyWarned.add(key)
console.info(`${this.tags.warn} ${message}`, ...args)
}
}

getConnectionInfo(): Result<ConnectionInfo> {
return ok({
maxBindValues: 100,
})
}

// eslint-disable-next-line @typescript-eslint/require-await
async startTransaction(): Promise<Result<Transaction>> {
const options: TransactionOptions = {
Expand Down
1 change: 1 addition & 0 deletions packages/driver-adapter-utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export type Error =

export type ConnectionInfo = {
schemaName?: string
maxBindValues?: number
}

// Current list of official Prisma adapters
Expand Down

0 comments on commit fe2ab35

Please sign in to comment.