Skip to content

Commit b089cef

Browse files
author
Mike Eldridge
committed
map { '!=' : null } in queries to IS NOT NULL via knex's whereNotNull() call
1 parent 7cac235 commit b089cef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,11 @@ class DSSqlAdapter {
338338
if (op === '==' || op === '===') {
339339
query = query.where(field, v)
340340
} else if (op === '!=' || op === '!==') {
341-
query = query.where(field, '!=', v)
341+
if (v === null) {
342+
query = query.whereNotNull(field)
343+
} else {
344+
query = query.where(field, '!=', v)
345+
}
342346
} else if (op === '>') {
343347
query = query.where(field, '>', v)
344348
} else if (op === '>=') {

0 commit comments

Comments
 (0)