class
CQL::Postgres::ResultSet
- CQL::Postgres::ResultSet
- DB::ResultSet
- Reference
- Object
Overview
Reads rows through crystal-db's ResultSet interface, so read(Int32),
read(String?) and DB::Serializable models work. The rows come from a
complete Result, or lazily from a RowStream.
Defined in:
postgres/result_set.crConstructors
-
.new(statement : DB::Statement, columns : Array(Column), rows : Iterator(Array(Types::Value)), rows_affected : -> Int64, detached : Bool = false)
A detached set reads rows that outlived their statement's connection checkout (or a stream), so closing it must not release that connection.
- .new(statement : DB::Statement, result : Result, detached : Bool = false) : ResultSet
- .new(statement : DB::Statement, stream : RowStream) : ResultSet
Instance Method Summary
-
#column_count : Int32
Returns the number of columns in the result
-
#column_name(index : Int32) : String
Returns the name of the column in
index0-based position. -
#move_next : Bool
Move the next row in the result.
-
#next_column_index : Int32
Returns the column index that corresponds to the next
#read. -
#read
Reads the next column value
- #rows_affected : Int64
Constructor Detail
A detached set reads rows that outlived their statement's connection checkout (or a stream), so closing it must not release that connection.
Instance Method Detail
Returns the number of columns in the result
Returns the name of the column in index 0-based position.
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.