Custom string collation: opt-in to trust the provider's order, so ordered windows page instead of loading the full source
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- typescript
- Domaine
- database
Piste de recherche
Start with the custom string collation handling added in #1904, then trace requiresFullSource, computeSubscriptionOrderByHints, canExpressCursorOrder, and the cursor comparison functions. The issue describes tests for bounded first-page queries, collated cursor paging, untrusted collations, and comparison identity; use those cases to check that trusted provider ordering enables paging while the default remains unchanged.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Since #1904, a custom string collation ({ stringSort: 'custom', compare }) marks every ordered query requiresFullSource, and computeSubscriptionOrderByHints drops orderBy/limit. That is the safe default when the backend's order is unknown. But some backends order strings with exactly that collation: InstantDB answers ordered/limited queries in Postgres glibc en_US, and our comparator matches it row for row (verified on 5,519 live rows).
Today those backends have two options. They can sort lexically, which gives the wrong pages. Or they can use the custom collation, and then every ordered window, on any field, requests its whole filtered source, because the collection default applies to every clause.
Proposal: an opt-in on the custom collation:
defaultStringCollation: {
stringSort: 'custom',
compare: comparePostgresText,
trustProviderOrder: true,
}
With it set:
requiresFullSourceand the subscription hints treat the order as provider-pageable, as for lexical order.canExpressCursorOrderaccepts string values under it.- The cursor's
gt/ltcarry the collation, so local evaluation agrees with the provider.gt/gte/lt/ltetake an optionalCustomStringCollationthird argument, stored on theFunc(not as an argument, so query identity still hashes; its identity is canonicalized like an orderBy collation).
Index range optimization skips collated comparisons.
Without the flag nothing changes. We have this implemented on top of 0.15.2 with tests (bounded first page, collated cursor paging, untrusted collations unchanged, comparison identity), and the full @tanstack/db suite passes. Happy to open a PR.
- Langage dominant
- TypeScript
- Étoiles
- 3.9k
- Forks
- 277
- Merge moyen
- 18 h 7 min
- PR mergées (30 j)
- 228
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de TanStack/db
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 1-2 jours Accessibilité débutants 48/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 1-2 jours Accessibilité débutants 48/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 1-2 jours Accessibilité débutants 45/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de TanStack/db
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
braintrustdata/braintrust-sdk-javascript#2659 ·
Les mainteneurs répondent en général sous 1 jour
-
body-parser 2.3.0 in the published ai-dial-chat-bff image is vulnerable (CVE-2026-111181, HIGH)Peut-être pris @illya-havsiyevych l’a pris aujourd’hui. Ouvertebug
Difficulté 1/5 1-3 heures Accessibilité débutants 87/100
epam/ai-dial-chat#9566 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
Les mainteneurs répondent en général sous 1 jour
-
はさみアイコンを修正するOuvertebug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 68/100
-
resource.reload() while params is in error switches the resource to 'idle' instead of retryingOuvertearea: core
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour