On Sat, Nov 19, 2005 at 10:32:47PM -0700, Michael Fuhr wrote:
> You could also convert the PGresult object into an array of PGrow
> objects with a one-liner, although you wouldn't get automatic bytea
> handling as in the function you posted:
>
> rows = res.collect
Other possibilities are res.to_a, res.entries, res.result, and
res.rows, which all do the same thing: return an array of PGrow
objects. The collect, to_a, and entries methods are provided by
the Enumerable mixin; the result and rows methods are aliases for
entries, which is synonymous with to_a. Using any of these methods
ultimately results in calling PGresult#each, which yields the PGrow
objects.
--
Michael Fuhr