class CQL::Postgres::ResultSet

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.cr

Constructors

Instance Method Summary

Constructor Detail

def self.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.


[View source]
def self.new(statement : DB::Statement, result : Result, detached : Bool = false) : ResultSet #

[View source]
def self.new(statement : DB::Statement, stream : RowStream) : ResultSet #

[View source]

Instance Method Detail

def column_count : Int32 #
Description copied from class DB::ResultSet

Returns the number of columns in the result


[View source]
def column_name(index : Int32) : String #
Description copied from class DB::ResultSet

Returns the name of the column in index 0-based position.


[View source]
def move_next : Bool #
Description copied from class DB::ResultSet

Move the next row in the result. Return false if no more rows are available. See #each


[View source]
def next_column_index : Int32 #
Description copied from class DB::ResultSet

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.


[View source]
def read #
Description copied from class DB::ResultSet

Reads the next column value


[View source]
def rows_affected : Int64 #

[View source]