Skip to content

query_all with a block #165

@rdp

Description

@rdp

Seems there is a block form to read a query ResultSet, what I reached for today was a block form with types specified:

Basically def query_all(query, *args_, args : Array? = nil, as types : Tuple) with a block to receive the values:

db.query_all("select 'a', 1", as: {String, Int32}) do |mystring, myint|

end

Just might be a nice syntactic sugar. Same for the NamedTuple version. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions