lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 18/06/2015, at 2:19 pm, Coda Highland <chighland@gmail.com> wrote:
> 
> I would guess the u stands for "unpacked" since that's the operation
> that would transform a row stored in an array into multiple returns.

That makes sense.  Thanks.

> Personally I would offer rows() as the array version and then extend
> that with adapters, such as rows():asTable() or rows():asValues().

Depending on the API you get from the database, you can build asTable and asValues without an intermediate table. In the case of asValues, this means avoiding unpack, which is a little slow, and you can return values from the database without creating any tables at all, which can help if there’s a lot of rows.

But the naming convention you suggest isn’t bad.  I’d be inclined to mark the array one too.