brianc/node-sql — pull request #12 by jmreidy (2012-12-18 22:36:49+00:00)
Title: adding groupBy and arrayAgg

Begin adding aggregate functions to node-sql (#8).

This commit adds a `GROUP BY` support, using a `group` method just like the existing `order` method.

It also adds support for `array_agg` for columns. The `array_agg` functionality follows the example of column aliasing: `

..arrayAgg('')`. If no `alias` is provided to `arrayAgg`, the query will simply pluralize the name with an "s". For example, `post.content.arrayAgg()` will produce `array_agg("post"."content") as "contents"`.