public function where(...$expressions) { /** * @var $this IStatement */ $where = WhereClause::create($expressions); $this->addClause($where); return $this; }
public function testNullBuilder() { $this->assertEquals("WHERE name IS NULL AND description IS NOT NULL", QueryAssembler::stringify(WhereClause::create(['name' => null, 'NOT' => ['description' => null]]))); }
public function testNoPredicates() { $where = WhereClause::create(); $where->addPredicate(new PredicateSet()); $this->assertEquals('WHERE ', CqlAssembler::stringify($where)); }
public function testInPredicate() { $this->assertEquals('WHERE field1 IN ("value1","value2")', QueryAssembler::stringify(WhereClause::create(['field1' => ['value1', 'value2']]))); $this->setExpectedException('\\Packaged\\QueryBuilder\\Exceptions\\Assembler\\QueryBuilderAssemblerException', 'Cannot assemble an empty ArrayExpression'); QueryAssembler::stringify(WhereClause::create(['field1' => []])); }