Feature request: Support PG "Row Constructor Comparison" for cursor based pagination

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

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
postgresql
Domain
databases

Research direction

Start with the PostgreSQL row-wise comparison documentation linked in the issue, then locate the query-generation entry point that handles WHERE predicates and cursor-based pagination. Done means expressions such as WHERE (id, title) > ('a', 'a') are accepted and produce working cursor pagination without the more complex equivalent condition.

Written by the indexing model from the issue text.

Description

feature request triage

Is your feature request related to a problem? Please describe.
Would be great to support row constructor comparison in order to be able to do cursor based pagination in a cleaner way.

Docs here: https://www.postgresql.org/docs/current/functions-comparisons.html#ROW-WISE-COMPARISON

Describe the solution you'd like
WHERE (id, title) > ('a', 'a') should be supported.

Additional context
It's still possible to achieve cursor pagination with a more complex where, but supporting this feature would simplify things a lot.

On version 1.6.9

Image Image
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.