Mallard
Search Results for

    Show / Hide Table of Contents

    Struct DuckDbBlob

    Represents a blob in DuckDB, as an element in some vector.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Mallard.Types
    Assembly: Mallard.dll
    Syntax
    public ref struct DuckDbBlob
    Remarks

    This type is only used for reading elements from a DuckDB vector. (In DuckDB's C API, it corresponds to duckdb_string_t.) It is a "ref struct" as it may internally point to natively-allocated memory, which must be scoped to the lifetime of the vector (DuckDbVectorReader<T>).

    Semantically, this structure is nothing more than ReadOnlySpan<byte> on the blob data, which can be accessed through the property Span. DuckDB's representation of blobs is obviously different from ReadOnlySpan<T> so that type cannot be used directly in DuckDbVectorReader<T> to read vector elements.

    This type is not used for sending values from .NET to DuckDB, since DuckDB needs to allocate and manage the memory blocks used to hold variable-length data, and such operations cannot be surfaced safely using .NET structures alone.

    Properties

    | Edit this page View Source

    Span

    The content of the blob.

    Declaration
    public readonly ReadOnlySpan<byte> Span { get; }
    Property Value
    Type Description
    ReadOnlySpan<byte>
    Remarks

    There is an inlined buffer within DuckDbBlob for short blobs which the returned span may point to. So this instance must outlive the span, enforced by this property being marked to be an "unscoped reference".

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX