{
  "slug": "sqlite-collation",
  "term": "SQLite collation",
  "aliases": [
    "SQLite collating sequence",
    "application-defined collation"
  ],
  "definition": "A SQLite collation is a named text-comparison rule used to determine ordering and equality in database operations.",
  "note": "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. [collation-api]\n\nRebuilding 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. [reindex] [experiment]",
  "related": [
    "sqlite-expression-index",
    "sqlite-quick-check",
    "backup-verification"
  ],
  "citations": [
    {
      "id": "collation-api",
      "title": "SQLite C API: Define New Collating Sequences",
      "url": "https://sqlite.org/c3ref/create_collation.html",
      "accessed": "2026-10-18"
    },
    {
      "id": "reindex",
      "title": "SQLite REINDEX: rebuild scope and name resolution",
      "url": "https://www.sqlite.org/lang_reindex.html",
      "accessed": "2026-10-18"
    },
    {
      "id": "experiment",
      "title": "Hesela: SQLite index runtime experiment",
      "url": "https://hesela.com/analyses/sqlite-index-runtime-dependencies/",
      "accessed": "2026-10-18"
    }
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-18",
  "provenance": [
    "Constructed fixtures on SQLite 3.45.1; callback changes deliberately violate existing index assumptions. No defect, incident-rate or cross-platform migration claim."
  ]
}
