We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 92cb640 commit c0384f3Copy full SHA for c0384f3
packages/pg/lib/query.js
@@ -160,6 +160,16 @@ class Query extends EventEmitter {
160
if (this.values && !Array.isArray(this.values)) {
161
return new Error('Query values must be an array')
162
}
163
+ if (this.values) {
164
+ for (const value of this.values) {
165
+ if (value === undefined) {
166
+ return new Error('Query parameter value cannot be undefined.');
167
+ }
168
+ if (value instanceof Date && isNaN(value.getTime())) {
169
+ return new Error('Query parameter value cannot be an invalid date.');
170
171
172
173
if (this.requiresPreparation()) {
174
this.prepare(connection)
175
} else {
0 commit comments