Adbc.Field (adbc v0.12.0)

Copy Markdown View Source

Represents the schema definition of a column.

A field describes the name, type, and metadata of a column without containing any data.

Use new/2 to create a field:

Adbc.Field.new(:s32, name: "id")
Adbc.Field.new({:list, Adbc.Field.new(:s32)}, name: "ids")

Summary

Functions

Creates a new field with the given type and options.

Types

data_type()

@type data_type() ::
  :boolean
  | signed_integer()
  | unsigned_integer()
  | floating()
  | :binary
  | :large_binary
  | :binary_view
  | :string
  | :large_string
  | :string_view
  | :date32
  | :date64
  | time()
  | timestamp()
  | duration()
  | interval()
  | decimal()
  | {:fixed_size_binary, non_neg_integer()}
  | {:list, t()}
  | {:large_list, t()}
  | {:list_view, t()}
  | {:large_list_view, t()}
  | {:fixed_size_list, t(), integer()}
  | {:struct, [t()]}
  | {:map, t(), t()}
  | {:dictionary, t(), t()}
  | {:run_end_encoded, t(), t()}

decimal128()

@type decimal128() :: {:decimal128, precision128(), integer()}

decimal256()

@type decimal256() :: {:decimal256, precision256(), integer()}

decimal()

@type decimal() :: decimal128() | decimal256()

duration()

@type duration() ::
  {:duration, :seconds}
  | {:duration, :milliseconds}
  | {:duration, :microseconds}
  | {:duration, :nanoseconds}

floating()

@type floating() :: :f16 | :f32 | :f64

interval()

@type interval() ::
  {:interval, :month} | {:interval, :day_time} | {:interval, :month_day_nano}

interval_unit()

@type interval_unit() :: :month | :day_time | :month_day_nano

precision128()

@type precision128() :: 1..38

precision256()

@type precision256() :: 1..76

signed_integer()

@type signed_integer() :: :s8 | :s16 | :s32 | :s64

t()

@type t() :: %Adbc.Field{
  metadata: map() | nil,
  name: String.t() | nil,
  type: data_type()
}

time32()

@type time32() :: {:time32, :seconds} | {:time32, :milliseconds}

time64()

@type time64() :: {:time64, :microseconds} | {:time64, :nanoseconds}

time()

@type time() :: time32() | time64()

time_unit()

@type time_unit() :: :seconds | :milliseconds | :microseconds | :nanoseconds

timestamp()

@type timestamp() ::
  {:timestamp, :seconds, String.t()}
  | {:timestamp, :milliseconds, String.t()}
  | {:timestamp, :microseconds, String.t()}
  | {:timestamp, :nanoseconds, String.t()}

unsigned_integer()

@type unsigned_integer() :: :u8 | :u16 | :u32 | :u64

Functions

new(type, opts \\ [])

@spec new(data_type(), Keyword.t()) :: t()

Creates a new field with the given type and options.

Options

  • :name - The name of the field
  • :metadata - A map of metadata