class CQL::Postgres::BinaryCopy::Reader

Overview

Cuts the chunks of a COPY ... TO STDOUT (FORMAT binary) back into rows, whatever the chunk boundaries are, and decodes each field by its column type. A row is decoded once, when all of it has arrived; until then only its field lengths are walked, and the bytes are not copied again.

Defined in:

postgres/binary_copy.cr

Constant Summary

COMPACT_AFTER = 1 << 20

Consumed bytes are dropped from the buffer once this many have piled up.

Constructors

Instance Method Summary

Constructor Detail

def self.new(types : Array(UInt32), &on_row : Array(Types::Value) -> ) #

[View source]

Instance Method Detail

def feed(chunk : Bytes) : Nil #

[View source]
def finish : Nil #

Raises unless the stream ended with the trailer.


[View source]