Enumerate columns in result_set

This commit is contained in:
Santiago Palladino 2016-03-28 19:29:15 -03:00
parent 344804dd79
commit 5773faaa5c
2 changed files with 21 additions and 0 deletions

View file

@ -41,6 +41,13 @@ module DB
end
end
# Iterates over all the columns
def each_column
column_count.times do |x|
yield column_name(x), column_type(x)
end
end
# Move the next row in the result.
# Return `false` if no more rows are available.
# See `#each`