SQLite collation
A SQLite collation is a named text-comparison rule used to determine ordering and equality in database operations.
Application-defined collations are registered on a connection. A shared name does not guarantee that two application versions use identical comparison rules; an existing index can disagree with a changed rule. [1]
Rebuilding an index under the intended comparator can restore consistency, but changing equality can also make existing keys collide. In a two-row control, A and a became equal and rebuilding the UNIQUE index failed with SQLITE_CONSTRAINT_UNIQUE. The rolled-back fixture retained both rows and its original hash. [2] [3]
Relations
- related
- sqlite-expression-index, sqlite-quick-check, backup-verification
Citations
- SQLite C API: Define New Collating Sequences
- SQLite REINDEX: rebuild scope and name resolution
- Hesela: SQLite index runtime experiment
Sources & caveats
- Constructed fixtures on SQLite 3.45.1; callback changes deliberately violate existing index assumptions. No defect, incident-rate or cross-platform migration claim.
Published by Hesela team · Updated
Report a correction · Editorial standards · Reuse guidance
Cite this page
Hesela team. SQLite collation. Hesela. 2026-10-18. https://hesela.dev/terms/sqlite-collation/