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

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests