Skip to content

Commit 5c9342d

Browse files
committed
Add readme
Signed-off-by: Aleksandr Shilov <alex.shilov.by@gmail.com>
1 parent a47316f commit 5c9342d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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"}

0 commit comments

Comments
 (0)