pub struct OwnedValue { /* private fields */ }Expand description
An owned standalone duckdb_value (destroyed once on drop) with introspection.
Implementations§
Source§impl OwnedValue
impl OwnedValue
Sourcepub fn to_sql_string(&self) -> Option<String>
pub fn to_sql_string(&self) -> Option<String>
The value’s SQL string rendering (e.g. 42, 'text'), or None if DuckDB
produces none.
Sourcepub fn struct_child(&self, index: u64) -> Option<OwnedValue>
pub fn struct_child(&self, index: u64) -> Option<OwnedValue>
The child field at index of a STRUCT value, as an owned OwnedValue,
or None if out of range (or the value is not a struct).
Sourcepub fn get_hugeint(&self) -> Result<i128, DuckDBConversionError>
pub fn get_hugeint(&self) -> Result<i128, DuckDBConversionError>
Sourcepub fn get_uhugeint(&self) -> Result<u128, DuckDBConversionError>
pub fn get_uhugeint(&self) -> Result<u128, DuckDBConversionError>
Sourcepub fn get_date_days(&self) -> Result<i32, DuckDBConversionError>
pub fn get_date_days(&self) -> Result<i32, DuckDBConversionError>
The DATE value as a day count since the epoch (1970-01-01).
§Errors
Errors if the value is not a DATE.
Sourcepub fn get_time_micros(&self) -> Result<i64, DuckDBConversionError>
pub fn get_time_micros(&self) -> Result<i64, DuckDBConversionError>
Sourcepub fn get_time_ns_nanos(&self) -> Result<i64, DuckDBConversionError>
pub fn get_time_ns_nanos(&self) -> Result<i64, DuckDBConversionError>
Sourcepub fn get_time_tz_bits(&self) -> Result<u64, DuckDBConversionError>
pub fn get_time_tz_bits(&self) -> Result<u64, DuckDBConversionError>
The TIME WITH TIME ZONE value as its packed 64-bit representation
(micros + offset bits, per DuckDB’s duckdb_time_tz layout).
§Errors
Errors if the value is not a TIME_TZ.
Sourcepub fn get_timestamp_micros(&self) -> Result<i64, DuckDBConversionError>
pub fn get_timestamp_micros(&self) -> Result<i64, DuckDBConversionError>
The TIMESTAMP value as microseconds since the epoch.
§Errors
Errors if the value is not a TIMESTAMP.
Sourcepub fn get_timestamp_tz_micros(&self) -> Result<i64, DuckDBConversionError>
pub fn get_timestamp_tz_micros(&self) -> Result<i64, DuckDBConversionError>
The TIMESTAMP WITH TIME ZONE value as microseconds since the epoch (UTC).
§Errors
Errors if the value is not a TIMESTAMP_TZ.
Sourcepub fn get_timestamp_seconds(&self) -> Result<i64, DuckDBConversionError>
pub fn get_timestamp_seconds(&self) -> Result<i64, DuckDBConversionError>
Sourcepub fn get_timestamp_millis(&self) -> Result<i64, DuckDBConversionError>
pub fn get_timestamp_millis(&self) -> Result<i64, DuckDBConversionError>
The TIMESTAMP_MS value as milliseconds since the epoch.
§Errors
Errors if the value is not a TIMESTAMP_MS.
Sourcepub fn get_timestamp_nanos(&self) -> Result<i64, DuckDBConversionError>
pub fn get_timestamp_nanos(&self) -> Result<i64, DuckDBConversionError>
The TIMESTAMP_NS value as nanoseconds since the epoch.
§Errors
Errors if the value is not a TIMESTAMP_NS.
Sourcepub fn get_interval(&self) -> Result<IntervalParts, DuckDBConversionError>
pub fn get_interval(&self) -> Result<IntervalParts, DuckDBConversionError>
The INTERVAL value as its (months, days, micros) parts.
§Errors
Errors if the value is not an INTERVAL.