QuackDB.Interval (quackdb v0.3.0)

Copy Markdown View Source

DuckDB interval value preserving month, day, and microsecond components.

DuckDB stores intervals as three independent components instead of a single duration because months and days do not have fixed microsecond lengths.

Summary

Functions

Builds a DuckDB interval value.

Returns the interval as {months, days, microseconds}.

Types

t()

@type t() :: %QuackDB.Interval{
  days: integer(),
  microseconds: integer(),
  months: integer()
}

Functions

new(months \\ 0, days \\ 0, microseconds \\ 0)

@spec new(integer(), integer(), integer()) :: t()

Builds a DuckDB interval value.

to_tuple(interval)

@spec to_tuple(t()) :: {integer(), integer(), integer()}

Returns the interval as {months, days, microseconds}.