pub struct LogicalTypeHandle { /* private fields */ }Expand description
DuckDB Logical Type. https://duckdb.org/docs/sql/data_types/overview
Implementations§
Source§impl LogicalTypeHandle
impl LogicalTypeHandle
Sourcepub fn array(child_type: &Self, array_size: u64) -> Self
pub fn array(child_type: &Self, array_size: u64) -> Self
Creates an array type from its child type.
Sourcepub fn decimal_width(&self) -> u8
pub fn decimal_width(&self) -> u8
Retrieves the decimal width Returns 0 if the LogicalType is not a decimal
Sourcepub fn decimal_scale(&self) -> u8
pub fn decimal_scale(&self) -> u8
Retrieves the decimal scale Returns 0 if the LogicalType is not a decimal
Sourcepub fn struct_type(fields: &[(&str, Self)]) -> Self
pub fn struct_type(fields: &[(&str, Self)]) -> Self
Make a LogicalType for struct
Sourcepub fn union_type(fields: &[(&str, Self)]) -> Self
pub fn union_type(fields: &[(&str, Self)]) -> Self
Make a LogicalType for union
Sourcepub fn id(&self) -> LogicalTypeId
pub fn id(&self) -> LogicalTypeId
Logical type ID
Sourcepub fn try_id(&self) -> Result<LogicalTypeId, u32>
pub fn try_id(&self) -> Result<LogicalTypeId, u32>
Logical type ID, with forward-compatibility awareness.
Returns Ok(LogicalTypeId) for all known ids (including Invalid), and
Err(raw_id) when DuckDB returns an id this wrapper does not yet
recognize.
Sourcepub fn num_children(&self) -> usize
pub fn num_children(&self) -> usize
Logical type children num
Sourcepub fn child_name(&self, idx: usize) -> String
pub fn child_name(&self, idx: usize) -> String
Logical type child name by idx
Panics if the logical type is not a struct or union
Trait Implementations§
Source§impl Debug for LogicalTypeHandle
impl Debug for LogicalTypeHandle
Source§impl From<LogicalTypeId> for LogicalTypeHandle
impl From<LogicalTypeId> for LogicalTypeHandle
Source§fn from(id: LogicalTypeId) -> Self
fn from(id: LogicalTypeId) -> Self
Create a new LogicalTypeHandle from LogicalTypeId
Auto Trait Implementations§
impl Freeze for LogicalTypeHandle
impl RefUnwindSafe for LogicalTypeHandle
impl !Send for LogicalTypeHandle
impl !Sync for LogicalTypeHandle
impl Unpin for LogicalTypeHandle
impl UnwindSafe for LogicalTypeHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more