congow/Orient — pull request #132 by nrk (2012-08-01 13:14:22+00:00)
Title: Query builder fixes

This pull request groups various fixes and a few optimizations for the query builder component.

Most of the fixes involve proper support for integer, float, boolean and NULL values in `SELECT`, `INSERT`, `UPDATE` and queries.

- __SELECT__

```
$query->from(array("Test"))
->where('a = ?', "0")
->orWhere('b = ?', 0)
->orWhere("c = ?", false)
->orWhere("d = ?", NULL);
```

```
SELECT FROM Test WHERE a = "0" OR b = 0 OR c = FALSE OR d IS NULL
```

- __INSERT__

```
$query->insert()
->into("Test")
->fields(array('a', 'b', 'c', 'd', 'e'))
->values(array('0', 0, NULL, true, false));
```

```
INSERT INTO Test (a, b, c, d, e) VALUES ("0", 0, NULL, TRUE, FALSE)
```

- __UPDATE__

```
$query->update('Test')
->set(array('a' => "0", 'b' => 0, 'c' => false, 'd' => null));
```

```
UPDATE Test SET a = "0", b = 0, c = FALSE, d = NULL
```