Expand description
Collation callback trait, built-in collations, and registry (§9.4, §13.6).
Collations are pure comparators used by ORDER BY, GROUP BY, DISTINCT, and index traversal. They are open extension points.
compare is intentionally CPU-only and does not accept &Cx.
The CollationRegistry maps case-insensitive names to collation
implementations and is pre-populated with the three built-in collations.
§Contract
Implementations must be:
- Deterministic: same inputs always produce the same output.
- Antisymmetric:
compare(a, b)is the reverse ofcompare(b, a). - Transitive: if
a < bandb < c, thena < c.
Structs§
- Binary
Collation - BINARY collation: raw
memcmpbyte comparison. - Collation
Annotation - An operand’s collation annotation: the collation name and where it came from.
- Collation
Registry - Registry for collation functions, keyed by case-insensitive name.
- NoCase
Collation - NOCASE collation: ASCII case-insensitive comparison.
- Rtrim
Collation - RTRIM collation: trailing-space-insensitive comparison.
Enums§
- Collation
Source - Source of a collation for precedence resolution (§13.6).
Traits§
- Collation
Function - A collation comparator.
Functions§
- resolve_
collation - Resolve which collation to use for a binary comparison (§13.6).