robotpony/Presto — pull request #50 by adam-patterson (2013-07-03 21:15:46+00:00)
Title: Fixes #49. Support for array parameters in PDO wrapper.

We split queries into two types: `SELECT` queries and everything else. `SELECT` queries have parameters in the form `array(k1 => v1, ..., kn => vn)`. All other queries have parameters in the form:

~~~
array(
k1 => array('value' => v1, 'pdoType' => PDO::SOME_PDO_TYPE),
...,
kn => array('value' => vn, 'pdoType' => PDO::SOME_PDO_TYPE)
)
~~~

This adds two private helper functions to the db wrapper to expand array parameters. One is used for the `SELECT` style paramaterization, the other for the other query style.

__Note:__ while these can be combined into a single function (I started with it that way) it was more elegant, and clearer, to split them up for the different cases.