feat(postgrest): add csv, explain, head, dryRun, stripNulls, maxAffected and geojson to the typed transform builder - #1848
Conversation
…ted and geojson to the typed transform builder
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced 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. 📝 WalkthroughWalkthroughChangesThe typed PostgREST transform builder now supports null stripping, dry runs, affected-row limits, CSV, HEAD, GeoJSON, and configurable EXPLAIN responses. Tests cover request options, response types, and transform composition. SDK compliance metadata lists the new capabilities. Typed transform support
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to The added typed modifiers, tests, and capability metadata have no identified merge-blocking issue. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
…ter (#1850) ## Summary Main does not compile since #1848 and #1849 merged within minutes of each other. #1849 replaced the typed transform builder's `PostgrestTable` field with a `RowConverter<Row>` (`_rowFromJson`), and #1848 added `stripNulls`, `dryRun`, `maxAffected` and `csv` on top of the old field. Neither PR's CI saw the other, so every check on main and on the open PRs fails at compile time in `postgrest_typed_transform_builder.dart`: ``` Error: The getter '_table' isn't defined for the type 'PostgrestTypedTransformBuilder<Row, T>'. ``` ## Changes - The four methods from #1848 pass `_rowFromJson` to the private constructor, like the rest of the class does after #1849. - The two tests from #1848 that passed raw maps use `BookInsert` and `BookUpdate`, which #1849 made the only accepted payload types on the typed builder. - The `dryRun` dartdoc example uses `BookInsert` as well. No public API change. `dart analyze` on `packages` and `examples` is clean, `typed_query_test.dart` passes (49), DCM is clean. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved typed mutation operations so options such as dry runs, affected-row limits, CSV responses, and null stripping consistently preserve the expected result types. - Updated typed insert and update usage in mutation scenarios to ensure submitted data is handled with the correct typed representations. - **Documentation** - Updated the dry-run example to demonstrate usage with a typed insert value. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
What
Adds the result-shape modifiers that
PostgrestTransformBuilder<T>already has toPostgrestTypedTransformBuilder<Row, T>, so a typed caller no longer has to rebuild the query withfrom()to reach them.csv()Stringexplain(...)Stringhead()voidgeojson()Map<String, dynamic>dryRun()TstripNulls()TmaxAffected(int)TEach delegates to the wrapped untyped builder.
csv,dryRun,stripNullsandmaxAffectedreturn aPostgrestTypedTransformBuilder, soorder,limit,rangeand friends still chain after them.head,geojsonandexplainreturn aPostgrestTypedBuilder, matching how their untyped counterparts return a plainPostgrestBuilder.Why
SDK-1361 deliberately left these out to keep the first typed surface reviewable.
Tests
typed_query_test.dartgains aresult modifiersgroup that asserts the headers each method sends and that the row type survivesdryRun,stripNullsandmaxAffected.The new symbols are registered in
sdk-compliance.yamlnext to their untyped counterparts. Symbol, drift and schema checks pass locally against the pinned capability-matrix tooling.Closes https://linear.app/supabase/issue/SDK-1838
Summary by CodeRabbit
New Features
Tests
Documentation