Unified selector type for addressing keys in Concord.
Selectors are used across the KV, Transaction, and Sync APIs to specify which keys an operation targets. Three forms are supported:
{:key, binary()}— Exactly one key{:prefix, binary()}— All keys starting with the given prefix{:range, start :: binary(), end_exclusive :: binary()}— All keys in the half-open interval[start, end)
{:prefix, p} is sugar for {:range, p, p <> <<0xFF, 0xFF, ...>>}.
Summary
Functions
Checks if a key matches the given selector.
Returns the upper bound binary for a prefix scan.
Validates a selector value.
Types
Functions
Checks if a key matches the given selector.
Returns the upper bound binary for a prefix scan.
For a prefix p, the upper bound is p with each trailing byte incremented,
effectively matching all keys that start with p.
Validates a selector value.
Returns :ok if valid, {:error, reason} otherwise.