"WHERE column IS NOT NULL" with Kohana v3 Query Builder

MeatFlavourDev picture MeatFlavourDev · Sep 26, 2010 · Viewed 10.4k times · Source

Is it possible with Kohana v3 Query Builder to use the IS NOT NULL operator?

The where($column, $op, $value) method requires all three parameters and even if I specify

->where('col', 'IS NOT NULL', '')

it builds and invalid query eg.

SELECT * FROM table WHERE col IS NOT NULL '';

Answer

shadowhand picture shadowhand · Jan 23, 2011

The operator is not escaped:

->where('col', 'IS NOT', NULL)

No need to use DB::expr, Kohana already supports what you want.