View Source Adbc.Column (adbc v0.4.1)
Documentation for Adbc.Column
.
Adbc.Column
corresponds to a column in the table. It contains the column's name, type, and
data. The data is a list of values of the column's data type.
Summary
Functions
A column that contains binary values.
A column that contains booleans.
A column that contains date represented as 32-bit signed integers in UTC.
A column that contains date represented as 64-bit signed integers in UTC.
A column that contains 128-bit decimals.
A column that contains 256-bit decimals.
A column that contains durations represented as 64-bit signed integers.
A column that contains 16-bit half-precision floats.
A column that contains 32-bit single-precision floats.
A column that contains 64-bit double-precision floats.
A column that contains fixed size binaries.
Similar to list/2
, but the length of the list is the same.
A column that contains signed 8-bit integers.
A column that contains signed 16-bit integers.
A column that contains 32-bit signed integers.
A column that contains 64-bit signed integers.
A column that contains durations represented as signed integers.
A column that contains large binary values.
Similar to list/2
, but for large lists.
A column that contains UTF-8 encoded large strings.
A column that each row is a list of some type or nil.
A column that contains UTF-8 encoded strings.
A column that contains time represented as signed integers in UTC.
A column that contains timestamps represented as signed integers in the given timezone.
A column that contains unsigned 8-bit integers.
A column that contains unsigned 16-bit integers.
A column that contains un32-bit signed integers.
A column that contains un64-bit signed integers.
Types
@type data_type() :: :boolean | signed_integer() | unsigned_integer() | floating() | decimal_t() | :string | :large_string | :binary | :large_binary | {:fixed_size_binary, non_neg_integer()} | :date32 | :date64 | time_t() | timestamp_t() | duration_t() | interval_t()
@type decimal128() :: {:decimal, 128, precision128(), integer()}
@type decimal256() :: {:decimal, 256, precision256(), integer()}
@type decimal_t() :: decimal128() | decimal256()
@type duration_t() ::
{:duration, :seconds}
| {:duration, :milliseconds}
| {:duration, :microseconds}
| {:duration, :nanoseconds}
@type floating() :: :f32 | :f64
@type i8() :: -128..127
@type i16() :: -32768..32767
@type i32() :: -2_147_483_648..2_147_483_647
@type i64() :: -9_223_372_036_854_775_808..9_223_372_036_854_775_807
@type interval_month() :: i32()
@type interval_t() ::
{:interval, :month} | {:interval, :day_time} | {:interval, :month_day_nano}
@type interval_unit() :: :month | :day_time | :month_day_nano
@type precision128() :: 1..38
@type precision256() :: 1..76
@type signed_integer() :: :i8 | :i16 | :i32 | :i64
@type time32_t() :: {:time32, :seconds} | {:time32, :milliseconds}
@type time64_t() :: {:time64, :microseconds} | {:time64, :nanoseconds}
@type time_unit() :: :seconds | :milliseconds | :microseconds | :nanoseconds
@type u8() :: 0..255
@type u16() :: 0..65535
@type u32() :: 0..4_294_967_295
@type u64() :: 0..18_446_744_073_709_551_615
@type unsigned_integer() :: :u8 | :u16 | :u32 | :u64
Functions
@spec binary([binary() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains binary values.
Arguments
data
: A list of binary valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.binary([<<0>>, <<1>>, <<2>>])
%Adbc.Column{
name: nil,
type: :binary,
nullable: false,
metadata: %{},
data: [<<0>>, <<1>>, <<2>>]
}
@spec boolean([boolean()], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains booleans.
Arguments
data
: A list of booleansopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.boolean([true, false, true])
%Adbc.Column{
name: nil,
type: :boolean,
nullable: false,
metadata: %{},
data: [true, false, true]
}
@spec date32([Date.t() | i32() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains date represented as 32-bit signed integers in UTC.
Arguments
data
: a list, each element of which can be one of the following:- a
Date.t()
- a 32-bit signed integer representing the number of days since the Unix epoch.
- a
opts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
@spec date64([Date.t() | i64() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains date represented as 64-bit signed integers in UTC.
Arguments
data
: a list, each element of which can be one of the following:- a
Date.t()
- a 64-bit signed integer representing the number of milliseconds since the Unix epoch.
- a
opts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
@spec decimal128( [Decimal.t() | integer() | nil], precision128(), integer(), Keyword.t() ) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains 128-bit decimals.
Arguments
data
: a list, each element can be either- a
Decimal.t()
- an
integer()
- a
precision
: The precision of the decimal values; precision should be between 1 and 38scale
: The scale of the decimal valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
@spec decimal256( [Decimal.t() | integer() | nil], precision256(), integer(), Keyword.t() ) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains 256-bit decimals.
Arguments
data
: a list, each element can be either- a
Decimal.t()
- an
integer()
- a
precision
: The precision of the decimal values; precision should be between 1 and 76scale
: The scale of the decimal valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
@spec duration([i64() | nil], time_unit(), Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains durations represented as 64-bit signed integers.
Arguments
data
: a list of integer values representing the time in the specified unitunit
: specify the unit of the time value, one of the following::seconds
:milliseconds
:microseconds
:nanoseconds
opts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
@spec f16([float() | nil | :infinity | :neg_infinity | :nan], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains 16-bit half-precision floats.
Arguments
data
: A list of 32-bit single-precision float values (will be converted to 16-bit floats in C)opts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.f16([1.0, 2.0, 3.0])
%Adbc.Column{
name: nil,
type: :f16,
nullable: false,
metadata: %{},
data: [1.0, 2.0, 3.0]
}
@spec f32([float() | nil | :infinity | :neg_infinity | :nan], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains 32-bit single-precision floats.
Arguments
data
: A list of 32-bit single-precision float valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.f32([1.0, 2.0, 3.0])
%Adbc.Column{
name: nil,
type: :f32,
nullable: false,
metadata: %{},
data: [1.0, 2.0, 3.0]
}
@spec f64([float() | nil | :infinity | :neg_infinity | :nan], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains 64-bit double-precision floats.
Arguments
data
: A list of 64-bit double-precision float valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.f64([1.0, 2.0, 3.0])
%Adbc.Column{
name: nil,
type: :f64,
nullable: false,
metadata: %{},
data: [1.0, 2.0, 3.0]
}
@spec fixed_size_binary([binary() | nil], non_neg_integer(), Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains fixed size binaries.
Similar to binary/2
, but each binary value has the same fixed size in bytes.
Arguments
data
: A list of binary valuesnbytes
: The fixed size of the binary values in bytesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.fixed_size_binary([<<0>>, <<1>>, <<2>>], 1)
%Adbc.Column{
name: nil,
type: {:fixed_size_binary, 1},
nullable: false,
metadata: %{},
data: [<<0>>, <<1>>, <<2>>]
}
@spec fixed_size_list( [ %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() } | nil ], [i32()], Keyword.t() ) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
Similar to list/2
, but the length of the list is the same.
Arguments
data
: a list, each element of which can be one of the following:nil
Adbc.Column
Note that each
Adbc.Column
in the list should have the same type and length.fixed_size
: The fixed size of the list.opts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
@spec i8([i8() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains signed 8-bit integers.
Arguments
data
: A list of signed 8-bit integer valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.i8([1, 2, 3])
%Adbc.Column{
name: nil,
type: :i8,
nullable: false,
metadata: %{},
data: [1, 2, 3]
}
@spec i16([i16() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains signed 16-bit integers.
Arguments
data
: A list of signed 16-bit integer valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.i16([1, 2, 3])
%Adbc.Column{
name: nil,
type: :i16,
nullable: false,
metadata: %{},
data: [1, 2, 3]
}
@spec i32([i32() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains 32-bit signed integers.
Arguments
data
: A list of 32-bit signed integer valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.i32([1, 2, 3])
%Adbc.Column{
name: nil,
type: :i32,
nullable: false,
metadata: %{},
data: [1, 2, 3]
}
@spec i64([i64() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains 64-bit signed integers.
Arguments
data
: A list of 64-bit signed integer valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.i64([1, 2, 3])
%Adbc.Column{
name: nil,
type: :i64,
nullable: false,
metadata: %{},
data: [1, 2, 3]
}
@spec interval( [interval_month() | interval_day_time() | interval_month_day_nano() | nil], interval_unit(), Keyword.t() ) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains durations represented as signed integers.
Arguments
data
: a list, each element of which can be one of the following:if
unit
is:month
:- a 32-bit signed integer representing the number of months.
if
unit
is:day_time
:- a 2-tuple, both the number of days and the number of milliseconds are in 32-bit signed integers.
if
unit
is:month_day_nano
:- a 3-tuple, the number of months, days, and nanoseconds; the number of months and days are in 32-bit signed integers, and the number of nanoseconds is in 64-bit signed integers
unit
: specify the unit of the time value, one of the following::month
:day_time
:month_day_nano
opts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
@spec large_binary([binary() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains large binary values.
Similar to binary/2
, but for binary values larger than 2GB.
Arguments
data
: A list of binary valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.large_binary([<<0>>, <<1>>, <<2>>])
%Adbc.Column{
name: nil,
type: :large_binary,
nullable: false,
metadata: %{},
data: [<<0>>, <<1>>, <<2>>]
}
@spec large_list( [ %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() } | nil ], Keyword.t() ) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
Similar to list/2
, but for large lists.
Arguments
data
: a list, each element of which can be one of the following:nil
Adbc.Column
Note that each
Adbc.Column
in the list should have the same type.opts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
@spec large_string([String.t() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains UTF-8 encoded large strings.
Similar to string/2
, but for strings larger than 2GB.
Arguments
data
: A list of UTF-8 encoded string valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.large_string(["a", "ab", "abc"])
%Adbc.Column{
name: nil,
type: :large_string,
nullable: false,
metadata: %{},
data: ["a", "ab", "abc"]
}
@spec list( [ %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() } | nil ], Keyword.t() ) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that each row is a list of some type or nil.
Arguments
data
: a list, each element of which can be one of the following:nil
Adbc.Column
Note that each
Adbc.Column
in the list should have the same type.opts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
@spec string([String.t() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains UTF-8 encoded strings.
Arguments
data
: A list of UTF-8 encoded string valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.string(["a", "ab", "abc"])
%Adbc.Column{
name: nil,
type: :string,
nullable: false,
metadata: %{},
data: ["a", "ab", "abc"]
}
@spec time([Time.t() | nil] | [i64() | nil], time_unit(), Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains time represented as signed integers in UTC.
Arguments
data
:a list of
Time.t()
valuea list of integer values representing the time in the specified unit
Note that when using
:seconds
or:milliseconds
as the unit, the time value is limited to the range of 32-bit signed integers.For
:microseconds
and:nanoseconds
, the time value is limited to the range of 64-bit signed integers.
unit
: specify the unit of the time value, one of the following::seconds
:milliseconds
:microseconds
:nanoseconds
opts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
@spec timestamp( [NaiveDateTime.t() | nil] | [i64() | nil], time_unit(), String.t(), Keyword.t() ) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains timestamps represented as signed integers in the given timezone.
Arguments
data
:- a list of
NaiveDateTime.t()
value - a list of 64-bit signed integer values representing the time in the specified unit
- a list of
unit
: specify the unit of the time value, one of the following::seconds
:milliseconds
:microseconds
:nanoseconds
timezone
: the timezone of the timestampopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
@spec u8([u8() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains unsigned 8-bit integers.
Arguments
data
: A list of unsigned 8-bit integer valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.u8([1, 2, 3])
%Adbc.Column{
name: nil,
type: :u8,
nullable: false,
metadata: %{},
data: [1, 2, 3]
}
@spec u16([u16() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains unsigned 16-bit integers.
Arguments
data
: A list of unsigned 16-bit integer valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.u16([1, 2, 3])
%Adbc.Column{
name: nil,
type: :u16,
nullable: false,
metadata: %{},
data: [1, 2, 3]
}
@spec u32([u32() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains un32-bit signed integers.
Arguments
data
: A list of un32-bit signed integer valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.u32([1, 2, 3])
%Adbc.Column{
name: nil,
type: :u32,
nullable: false,
metadata: %{},
data: [1, 2, 3]
}
@spec u64([u64() | nil], Keyword.t()) :: %Adbc.Column{ data: term(), metadata: term(), name: term(), nullable: term(), type: term() }
A column that contains un64-bit signed integers.
Arguments
data
: A list of un64-bit signed integer valuesopts
: A keyword list of options
Options
:name
- The name of the column:nullable
- A boolean value indicating whether the column is nullable:metadata
- A map of metadata
Examples
iex> Adbc.Column.u32([1, 2, 3])
%Adbc.Column{
name: nil,
type: :u32,
nullable: false,
metadata: %{},
data: [1, 2, 3]
}