DB::ResultSet
Inherits DB::Disposable / Reference / Object
The response of a query performed on a Database.
See DB for a complete sample.
Each #read call consumes the result and moves to the next column.
Each column must be read in order.
At any moment a #move_next can be invoked, meaning to skip the
remaining, or even all the columns, in the current row.
Also it is not mandatory to consume the whole ResultSet, hence an iteration
through #each or #move_next can be stopped.
Note: depending on how the ResultSet was obtained it might be mandatory an
explicit call to #close. Check QueryMethods#query.
Note to implementors
- Override
#move_nextto move to the next row. - Override
#readreturning the next value in the row. - (Optional) Override
#read(t)for some typestfor which custom logic other than a simple cast is needed. - Override
#column_count,#column_name.
Constructors
Instance methods
Move the next row in the result.
Return false if no more rows are available.
See #each
Returns the column index that corresponds to the next #read.
If the last column of the current row has been read, it must return #column_count.