From 0e019bd7f97edd46cf8fd277d47fb400ca4af2bf Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 14 Feb 2018 09:30:42 -0700 Subject: [PATCH] Add a couple of tests showing how the null value would be used in a where filter --- types/knex/knex-tests.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/knex/knex-tests.ts b/types/knex/knex-tests.ts index 3aaefb6909..4391b49304 100644 --- a/types/knex/knex-tests.ts +++ b/types/knex/knex-tests.ts @@ -185,6 +185,10 @@ knex('users').where(() => { knex('users').where('votes', '>', 100); +// Let null be used in a two or 3 parameter where filter +knex('users').where('votes', null); +knex('users').where('votes', 'is not', null); + var subquery = knex('users').where('votes', '>', 100).andWhere('status', 'active').orWhere('name', 'John').select('id'); knex('accounts').where('id', 'in', subquery);