Feature request: Support `collate` option on `orderByExpr`

Open
#4,498 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
64/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
postgresql, typescript
Domain
databases

Research direction

Start by locating orderByExpr and references to SerializedOrderByClause, then read the existing order-by SQL serialization and its tests. Add coverage for the proposed collate option and verify that an orderByExpr produces an ORDER BY clause containing the requested COLLATE value without changing existing direction or null-ordering behavior.

Written by the indexing model from the issue text.

Description

feature request triage

Is your feature request related to a problem? Please describe.
I'd like to be able to provide a custom COLLATE in an orderByExpr

Describe the solution you'd like
Maybe

export type SerializedOrderByClause = {
  column: string
  direction?: `asc` | `desc` // omitted means 'asc'
  nulls?: `first` | `last`
  collate?: string
}

which would compile to something like

ORDER BY c COLLATE "de_DE";
Dominant language
TypeScript
Stars
10.4k
Forks
399
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from electric-sql/electric

All issues in electric-sql/electric

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.