Struct DuckDbColumnInfo
Describes the data type of (the items in) a column resulting from a DuckDB query.
Implements
Inherited Members
Namespace: Mallard
Assembly: Mallard.dll
Syntax
public readonly record struct DuckDbColumnInfo : IEquatable<DuckDbColumnInfo>
Remarks
The properties in this type provide information to decode data coming in from a DuckDB column. This information is sufficient for "simple" types (such as integers, decimals).
For "complex" types (of some composited/nested nature), specialized API calls to the DuckDB native library may be necessary to decode/describe them fully. Those API calls are made available elsewhere in this library as they require more complex state/resource management. This type optimizes for the by far the most common case, where basic information on the DuckDB type/column can be gathered cheaply upfront, and stored in an inert structure that can be passed around and accessed (in .NET code) with no restrictions.
This .NET type is also used to describe a DuckDB column that is nested within another, e.g. a member of a structure (STRUCT in DuckDB SQL).
The name of the column (if any) is not part of this information set, because it is irrelevant for decoding the data from the column. By omitting the name, this .NET type can also implement structural equality on the type information.
Properties
| Edit this page View SourceDecimalScale
The number of digits after the decimal point, when the logical type is Decimal.
Declaration
public byte DecimalScale { get; }
Property Value
Type | Description |
---|---|
byte | The number of digits, or zero if inapplicable. |
ElementSize
The "size" applicable to certain types of items that can be stored in a DuckDB vector.
Declaration
public int ElementSize { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
Item type | What this property holds |
---|---|
Fixed-sized array (ARRAY in DuckDB SQL) | The size of those arrays |
Enumeration (ENUM in DuckDB SQL) | The size (number of entries) in the enumeration type |
Fixed-point decimal number (DECIMAL in DuckDB SQL) | The maximum number of decimal digits ("width") |
Structures (STRUCT in DuckDB SQL) | The number of members in the structural type |
StorageKind
The actual representation kind used for storage within vectors, when the logical type is Enum or Decimal.
Declaration
public DuckDbValueKind StorageKind { get; }
Property Value
Type | Description |
---|---|
DuckDbValueKind | The storage kind of element in the vector, or Invalid if inapplicable. |
ValueKind
The kind of item data, used to verify correctly-typed access to items of the vector.
Declaration
public DuckDbValueKind ValueKind { get; }
Property Value
Type | Description |
---|---|
DuckDbValueKind |