lib/duckdb/result.rb in duckdb-0.10.2.0 vs lib/duckdb/result.rb in duckdb-1.0.0.0

- old
+ new

@@ -51,19 +51,21 @@ end alias column_size column_count alias row_size row_count + @use_chunk_each = true + class << self def new raise DuckDB::Error, 'DuckDB::Result cannot be instantiated directly.' end - def use_chunk_each=(val) - raise DuckDB::Error, 'chunk_each is not available. Install duckdb >= 0.8.0 and rerun `gem install duckdb`.' unless instance_methods.include?(:chunk_each) + def use_chunk_each=(value) + warn('`changing DuckDB::Result.use_chunk_each to false` will be deprecated.') if value == false - @use_chunk_each = val + @use_chunk_each = value end def use_chunk_each? !!@use_chunk_each end @@ -89,18 +91,20 @@ end end end def row(row_index) + warn("#{self.class}##{__method__} will be deprecated. set `DuckDB::Result.use_chunk_each = true`.") row = [] column_count.times do |col_index| row << (_null?(row_index, col_index) ? nil : to_value(row_index, col_index)) end row end def to_value(row_index, col_index) + warn("#{self.class}##{__method__} will be deprecated. set `DuckDB::Result.use_chunk_each = true`.") send(TO_METHODS[_column_type(col_index)], row_index, col_index) end def enum_dictionary_values(col_index) values = [] @@ -111,22 +115,26 @@ end private def _to_hugeint(row, col) + warn("#{self.class}##{__method__} will be deprecated.") _to_string(row, col).to_i end def _to_hugeint_internal(row, col) + warn("#{self.class}##{__method__} will be deprecated.") lower, upper = __to_hugeint_internal(row, col) Converter._to_hugeint_from_vector(lower, upper) end def _to_decimal(row, col) + warn("#{self.class}##{__method__} will be deprecated.") BigDecimal(_to_string(row, col)) end def _to_decimal_internal(row, col) + warn("#{self.class}##{__method__} will be deprecated.") lower, upper, width, scale = __to_decimal_internal(row, col) Converter._to_decimal_from_hugeint(width, scale, upper, lower) end end end