Class: ChConnect::NativeFormatParser Private
- Inherits:
-
Object
- Object
- ChConnect::NativeFormatParser
- Defined in:
- lib/ch_connect/native_format_parser.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Parser for ClickHouse Native binary format.
Constant Summary collapse
- DATE_EPOCH =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Date.new(1970, 1, 1)
Instance Method Summary collapse
-
#initialize(body) ⇒ NativeFormatParser
constructor
private
Creates a new parser.
-
#parse ⇒ Response
private
Parses the response body and returns a Response.
Constructor Details
#initialize(body) ⇒ NativeFormatParser
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a new parser.
15 16 17 18 19 20 |
# File 'lib/ch_connect/native_format_parser.rb', line 15 def initialize(body) @reader = BodyReader.new(body) @columns = [] @types = [] @rows = [] end |
Instance Method Details
#parse ⇒ Response
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Parses the response body and returns a Response.
26 27 28 29 30 31 |
# File 'lib/ch_connect/native_format_parser.rb', line 26 def parse parse_block until @reader.eof? Response.new(columns: @columns, types: @types, rows: @rows) ensure @reader.close end |