Repository navigation
feat(postgrest): apply a raw PostgREST filter - #1010
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A caller can apply a raw PostgREST filter, with the operator and value written in PostgREST syntax. This is the escape hatch for filters the
Operatormembers do not cover.Capability:
database.using_filters.raw(Filter Raw).Public API
A new
Filteroverload that takes the operator as a string, on tables and on function calls:No new types. An existing call with an
Operatorvalue still resolves to the generic overload.Behavior
<column>=<op>.<criterion>, with the operator and criterion exactly as given: no quoting, escaping or%to*translation beyond URL encoding.opmay carry anot.prefix.Clear()drops them.PGRST100, and the SDK throwsPostgrestExceptionthrough the existing error path.Not,OrorAnd.Deviations from supabase-js
string, where supabase-js takesunknownand callstoString(). The caller controls formatting and culture.filter(), a raw filter is not nested inor. The raw-stringor(filters)of supabase-js is a separate capability.Tests
RawFilterTestsinandnot.inagainst a live PostgREST, an unknown operator throws, narrowing a function callRawFilterRequestTestsRawFilterUrlTestsnot.prefix, two filters on one column, mixed with typed filters,Clear()Diff coverage: 100% (9 lines). Mutation: 5/5 killed on the changed lines, 0 survivors.