Skip to content

Calling limit()/offset()/range() twice sends duplicate query params #1617

Description

@twelfthlabor

Calling .limit() twice on one chain sends both values:

client.from_("t").select("*").limit(10).limit(20)
# sends: select=*&limit=10&limit=20

Same for .offset() and .range(). On current main these use params.add() while order() uses params.set() and merges, so this looks like an oversight.

Concrete problem: against local PostgREST 16.2 the server applies the last value (20 wins), but params["limit"] on the built request returns the first (10). The client disagrees with the server about what the query is.

Note this differs from #1208, which is about reusing a builder across executes. This is setter semantics in a single chain. Foreign-table variants share the same .add path.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpythonPull requests that update Python code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions