QuackDB.Protocol.LogicalType (quackdb v0.1.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)

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

physical_type(type)

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

struct_children(type)

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