DuckDB TIMESTAMP_NS value stored as nanoseconds since the Unix epoch.
Elixir's NaiveDateTime type stores microseconds, so this struct preserves
DuckDB's nanosecond precision while offering conversion to a truncated
NaiveDateTime.
Summary
Functions
Builds a TIMESTAMP_NS value from an Elixir NaiveDateTime.
Builds a TIMESTAMP_NS value from nanoseconds since the Unix epoch.
Returns the stored nanoseconds since the Unix epoch.
Converts to an Elixir NaiveDateTime, truncating sub-microsecond precision.
Types
@type t() :: %QuackDB.NanosecondTimestamp{nanoseconds: integer()}
Functions
@spec from_naive_datetime(NaiveDateTime.t()) :: t()
Builds a TIMESTAMP_NS value from an Elixir NaiveDateTime.
Builds a TIMESTAMP_NS value from nanoseconds since the Unix epoch.
Returns the stored nanoseconds since the Unix epoch.
@spec to_naive_datetime(t()) :: NaiveDateTime.t()
Converts to an Elixir NaiveDateTime, truncating sub-microsecond precision.