The query builder isn't designed to work in this way and I think I prefer this method to be honest. Feels more lightweight. 

Sent from my iPhone

On 11 Feb 2013, at 19:29, Claudio Albertin <notifications@github.com> wrote:

> In tests/DatabaseQueryBuilderSQLTest.php:
> 
> > +		$sql = $this->builder->select(['table' => 'users', 'conds' => ['id' => 1, 'user' => Database::where_or('Nat')]]);
> > +		$this->assertEquals('SELECT * FROM `users` WHERE `id` = 1 OR `user` = \'Nat\';', $sql);
> > +	}
> > +
> > +	public function testSelectChoosingOperator() {
> > +		$sql = $this->builder->select(['table' => 'users', 'conds' => ['id' => Database::where_gt(1)]]);
> > +		$this->assertEquals('SELECT * FROM `users` WHERE `id` > 1;', $sql);
> > +	}
> > +
> > +	public function testSelectWithTwoWheresChoosingConnectorAndOperator() {
> > +		$sql = $this->builder->select(['table' => 'users', 'conds' => ['id' => 1, 'logins' => Database::where_or(Database::where_gte(1))]]);
> > +		$this->assertEquals('SELECT * FROM `users` WHERE `id` = 1 OR `logins` >= 1;', $sql);
> > +	}
> > +
> > +	public function testSelectWithGroups() {
> > +		$sql = $this->builder->select([
> The syntax of complex queries seems to be very complicated. Is there no easier, more intuitive way to do this with the current code?
> 
> $this->builder
>     ->select('users')
>     ->where(['id' => 1, 'name' => 'Nat'])
>     ->or_where(['id' => 2, 'name' => 'Claudio');
> 
> $this->builder->select('users', [1, 2]);
> 
> $this->builder
>     ->select('users')
>     ->open()
>         ->where('id', '1')
>         ->and_where('name', 'Nat')
>     ->close()
>     ->open()
>         ->where('logins', '>', 0)
>         ->and_where_not('name', '')
>     ->close();
> —
> Reply to this email directly or view it on GitHub.
>