View Source Snowpack.Type (Snowpack v0.7.3)

Type conversions.

Note the :odbc return types for decoding can be found here: http://erlang.org/doc/apps/odbc/databases.html#data-types-

Link to this section Summary

Types

Date as {year, month, day}

Datetime

Input param.

Output value.

Time as {hour, minute, sec, usec}

Functions

Transforms :odbc return values to Elixir representations.

Transforms input params into :odbc params.

Link to this section Types

@type date() :: {1..9999, 1..12, 1..31}

Date as {year, month, day}

@type datetime() :: {date(), time()}

Datetime

@type param() :: bitstring() | number() | date() | time() | datetime() | Decimal.t()

Input param.

@type return_value() :: bitstring() | integer() | date() | datetime() | Decimal.t()

Output value.

@type time() :: {0..24, 0..60, 0..60, 0..999_999}

Time as {hour, minute, sec, usec}

@type value() :: :null | term()

Link to this section Functions

@spec decode(value(), opts :: Keyword.t()) :: return_value()

Transforms :odbc return values to Elixir representations.

@spec encode(value :: param(), opts :: Keyword.t()) :: {atom(), [nil | term()]}

Transforms input params into :odbc params.