feat(postgrest): add an isUnknown filter method - #1788
Conversation
Adds `PostgrestFilterBuilder.isUnknown`, which appends `is.unknown` so the SQL boolean UNKNOWN state can be filtered on without turning the `bool?` of `isFilter` into an enum. Closes #1609
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe PostgREST client now supports filtering for SQL ChangesUnknown filter support
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This adds an optional PostgREST filter for the UNKNOWN state without changing existing behavior or authorization paths; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Linked Issues checkExplanation The PR satisfies issue Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
PostgrestFilterBuilder.isFiltertakes abool?, so it coversis.null,is.trueandis.false, but not PostgREST's fourthisvalue,unknown.Rather than replacing the
bool?with an enum (a breaking change), this adds a dedicated method for the rarely used state, as suggested in #1609 (comment):Changes
PostgrestFilterBuilder.isUnknown(String column)appendsis.unknown, with a cross-reference from theisFilterdocs.is.unknownand that PostgREST accepts the filter.database.using_filters.isinsdk-compliance.yaml.Notes
isUnknownwas deliberately not added toSupabaseStreamFilterBuilder. Realtime validates filter values by casting them to the column type server-side, andunknownis not castable to boolean, so exposing it there could not be verified to work. On a boolean columnis unknownis also equivalent tois null, which streams already support.Closes #1609
Summary by CodeRabbit
New Features
isUnknownfilter for querying rows where a SQL boolean value isUNKNOWN.Documentation