QuackDB.Protocol.LogicalType (quackdb v0.2.0)

Copy Markdown View Source

Decoder and metadata helpers for DuckDB logical types.

Maps Quack logical type ids to names, derives physical storage types, and exposes nested type metadata used by vector decoding.

Summary

Types

id()

@type id() :: non_neg_integer()

t()

@type t() :: %QuackDB.Protocol.LogicalType{
  id: id(),
  name: atom() | nil,
  type_info: map() | nil
}

Functions

array_size(type)

@spec array_size(t()) :: non_neg_integer()

child_type(type)

@spec child_type(t()) :: t()

decode(binary)

encode(type)

@spec encode(t()) :: iodata()

fixed_size(type)

@spec fixed_size(atom()) :: pos_integer()

fixed_size?(type)

@spec fixed_size?(atom()) :: boolean()

id(name)

@spec id(atom()) :: id()

name(id)

@spec name(id()) :: atom() | nil

new(name, type_info \\ nil)

@spec new(atom(), map() | nil) :: t()

physical_type(type)

@spec physical_type(t()) :: atom()

struct_children(type)

@spec struct_children(t()) :: [%{name: String.t(), type: t()}]