1
[RFC] Query builder immutability and safe branching semantics across Supabase SDKs
Source: supabase/supabase#50049 · opened by @Vishv07
Motivation & Background In data-layer development, branching a base query builder instance is a standard pattern for pagination, dynamic filtering, and conditional querying: However, across non-JS Supabase SDKs (such as supabase-py and supabase-swift), filter and modifier methods mutate the internal builder instance in place instead of returning a copy-on-write clone. When branching as above, subsequent calls mutate base_query, causing race conditions, corrupted query parameters, and unexpected results across asynchronous tasks. Proposed Design 1. Copy-on-write Builder Chaining: Every filter/query modifier (eq, in_, order, range, limit) should return a new shallow clone of the builder with isolated query parameters and headers. 2. Explicit .clone() Helper: Provide an explicit .clone() method on PostgREST query builders for developers who wish to clone instances ahead of mutation. 3. SDK Cross-Language Alignment: Standardize query builder immutability semantics across supabase…
No pledges yet. Be the first to back this.
Comments
Similar requests
Feature Request: Add Bitbucket Support for Supabase Branching
5 votes · 0 comments
Persistent staging/prod project parity — schema + edge functions + auth sync without ephemeral branching
1 vote · 0 comments
Branching - workflow/git provider options
9 votes · 0 comments
Surface user impersonation in SDKs
3 votes · 0 comments
Proposal for adding type-safe for `.select()` function
5 votes · 0 comments
No comments yet.