Adds a where not in clause to the query. This behaves identically to the whereBetween method with the negateflag set to true. See the documentation for whereBetween for usage and examples.
whereColumn
Adds a where clause to a query that compares two columns.
Just as with where, when using "=" as the operator you can use a shorthand passing the second column in as the operator and leaving the second column null.
Adds a where not in clause to the query. This behaves identically to the whereExists method with the negateflag set to true. See the documentation for whereExists for usage and examples.
whereLike
A shortcut for calling where with "like" set as the operator.
You may find a whereExists method performs better for you than a whereIn with a subquery.
whereNotIn
Adds a where not in clause to the query. This behaves identically to the whereIn method with the negateflag set to true. See the documentation for whereIn for usage and examples.
whereRaw
Shorthand to add a raw SQL statement to the where clauses.
QueryBuilder
query.from( "users" ).whereRaw("id = ? OR email = ? OR is_admin = 1", [ 1,"foo" ] );
MySQL
SELECT*FROM`users`WHERE id = ? OR email = ? OR is_admin =1
whereNull
Adds a where null clause to the query.
QueryBuilder
query.from( "users" ).whereNull( "id" );
MySQL
SELECT*FROM`users`WHERE`id`ISNULL
whereNotNull
Adds a where not in clause to the query. This behaves identically to the whereNull method with the negateflag set to true. See the documentation for whereNull for usage and examples.
Dynamic Where Methods
qb uses onMissingMethod to provide a few different helpers when working with where... methods.
andWhere... and orWhere...
Every where... method in qb can be called prefixed with either and or or. Doing so will call the original method using the corresponding combinator.
If you call a method starting with where that does not match an existing qb method, qb will instead call the where method using the rest of the method name as the first column name. (The rest of the arguments will be shifted to account for this.) This also applies to andWhere{Column} and orWhere{Column} method signatures.