InfluxElixir.Client.Local.SQLSort (InfluxElixir v0.1.40)

Copy Markdown View Source

The ordering of values and rows for InfluxElixir.Client.Local's SQL, as the engine orders them (verified against InfluxDB 3 Core): DateTimes chronologically, numbers by InfluxElixir.Client.Local.SQLNumber (a UInt64 or a decimal by its value, an infinity beyond every finite float), nulls last when ascending and first when descending unless the query says NULLS FIRST / NULLS LAST; it is not term order, which puts a nil before every string and between false and true.

Summary

Types

How one ORDER BY key reads a value from an item.

A key's direction and where its nulls go.

Functions

Where a direction puts nulls when the query does not say.

Stable multi-key sort with a direction per key.

One key's order: :before, :after or :tie.

Whether a sorts at or before b, ascending.

Types

key()

How one ORDER BY key reads a value from an item.

placement()

@type placement() :: {:asc | :desc, :nulls_first | :nulls_last}

A key's direction and where its nulls go.

Functions

null_placement(arg1)

Where a direction puts nulls when the query does not say.

sort_by_keys(items, keys)

@spec sort_by_keys([term()], [key()]) :: [term()]

Stable multi-key sort with a direction per key.

Each item's key values are read once, not on every comparison, so the cost of a sort is its keys over the items and not over the comparisons.

value_before?(x, y, arg)

@spec value_before?(term(), term(), placement()) :: :before | :after | :tie

One key's order: :before, :after or :tie.

value_order(a, b)

@spec value_order(term(), term()) :: boolean()

Whether a sorts at or before b, ascending.