Skip to content

Commit 32e8fa4

Browse files
committed
Throw if max parameters exceeded
1 parent 753e2dc commit 32e8fa4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,9 @@ export default function Postgres(url, options) {
454454
const type = getType(x)
455455
, i = types.push(type-type)
456456

457+
if (i > 65534)
458+
throw errors.generic({ message: 'Max number of parameters exceeded', code: 'MAX_PARAMETERS_EXCEEDED' })
459+
457460
xargs.push(type)
458461
return '$' + i
459462
}

0 commit comments

Comments
 (0)