File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -138,12 +138,15 @@ Select all type-casted result set
138138@result = ClickHouse .connection.select_all(' SELECT * FROM visits' )
139139
140140# all enumerable methods are delegated like #each, #map, #select etc
141- # results of #to_a is type casted
141+ # results of #to_a is TYPE CASTED
142142@result .to_a # => [{"date"=>#<Date: 2000-01-01>, "id"=>1}]
143143
144+ # raw results (WITHOUT type casting)
145+ # much faster if selecting a large amount of data
146+ @result .data # => [{"date"=>"2000-01-01", "id"=>1}, {"date"=>"2000-01-02", "id"=>2}]
147+
144148# you can access raw data
145149@result .meta # => [{"name"=>"date", "type"=>"Date"}, {"name"=>"id", "type"=>"UInt32"}]
146- @result .data # => [{"date"=>"2000-01-01", "id"=>1}, {"date"=>"2000-01-02", "id"=>2}]
147150@result .statistics # => {"elapsed"=>0.0002271, "rows_read"=>2, "bytes_read"=>12}
148151@result .summary # => ClickHouse::Response::Summary
149152@result .headers # => {"x-clickhouse-query-id"=>"9bf5f604-31fc-4eff-a4b5-277f2c71d199"}
You can’t perform that action at this time.
0 commit comments