lib/duckdb/result.rb in duckdb-0.9.1.2 vs lib/duckdb/result.rb in duckdb-0.9.2
- old
+ new
@@ -56,12 +56,18 @@
end
end
def each
if self.class.use_chunk_each?
- return chunk_each unless block_given?
+ if streaming?
+ return _chunk_stream unless block_given?
- chunk_each { |row| yield row }
+ _chunk_stream { |row| yield row }
+ else
+ return chunk_each unless block_given?
+
+ chunk_each { |row| yield row }
+ end
else
warn('this `each` behavior will be deprecated in the future. set `DuckDB::Result.use_chunk_each = true` to use new `each` behavior.')
return to_enum { row_size } unless block_given?
row_count.times do |row_index|