module DuckDB
Constants
- ColumnDescription
-
DuckDB::ColumnDescriptionis an immutable value object describing a single column returned byDuckDB::TableDescription#column_descriptions.It is defined using
Data.defineand exposes three attributes:-
name— the column name as a String -
logical_type — a
DuckDB::LogicalTyperepresenting the column’s type -
has_default—trueif the column has a DEFAULT value,falseotherwise
A predicate alias
has_default?is provided for idiomatic Ruby usage.Requires
DuckDB>= 1.5.0.require 'duckdb' db = DuckDB::Database.open con = db.connect con.query("CREATE TABLE t (id INTEGER, name VARCHAR DEFAULT 'anon')") td = DuckDB::TableDescription.new(con, 't') cd = td.column_descriptions.last cd.name #=> "name" cd.logical_type.type #=> :varchar cd.has_default? #=> true
-
- DEPRECATED_CONSTANTS
- LIBRARY_VERSION
-
represents the version of the
DuckDBlibrary. IfDuckDB.library_versionis v0.2.0, thenDuckDB::LIBRARY_VERSIONis 0.2.0. - QueryProgress
- VERSION
-
The version string of ruby-duckdb. Currently, ruby-duckdb is NOT semantic versioning.
Attributes
Controls how DuckDB converts timestamp and time values without explicit time zone information.
-
‘:utc` - interpret values as UTC
-
‘:local` - (default) interpret values as local time, preserving existing behavior
Example:
DuckDB.default_timezone = :utc
This setting only affects conversion of values without time zone. Values with explicit time zone are always interpreted according to their offset.
Public Class Methods
Source
# File lib/duckdb.rb, line 59 def const_missing(name) deprecated = DEPRECATED_CONSTANTS[name] return super unless deprecated warn "DuckDB::#{name} is deprecated. Use #{deprecated} instead.", uplevel: 1 const_set(name, deprecated.split('::').reduce(Object) { |mod, part| mod.const_get(part) }) end
Source
# File lib/duckdb.rb, line 53 def default_timezone=(value) raise ArgumentError, 'DuckDB.default_timezone must be either :utc or :local.' unless %i[local utc].include?(value) @default_timezone = value end
Source
static VALUE duckdb_s_library_version(VALUE self) {
return rb_str_new2(duckdb_library_version());
}
Returns the version of the DuckDB library.
DuckDB.library_version # => "0.2.0"
Source
static VALUE duckdb_s_vector_size(VALUE self) {
return ULONG2NUM(duckdb_vector_size());
}
Returns the vector size of DuckDB. The vector size is the number of rows that are processed in a single vectorized operation.
DuckDB.vector_size # => 2048