Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query_all with a block #165

Open
rdp opened this issue Apr 6, 2022 · 0 comments
Open

query_all with a block #165

rdp opened this issue Apr 6, 2022 · 0 comments

Comments

@rdp
Copy link

rdp commented Apr 6, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant