You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(postgrest): send no columns parameter when bulk rows have no keys - #2209
No actionable comments were generated in the recent review.
Walkthrough
The query builder now omits the columns parameter when rows contain no keys. Tests cover this behavior for insert() and upsert() with an empty row.
Changes: Empty-row handling
Layer / File(s)
Summary
Column parameter and coverage packages/postgrest/lib/src/postgrest_query_builder.dart, packages/postgrest/test/insert_builder_test.dart
The query builder omits the columns parameter when the collected row keys are empty. Tests verify that insert() and upsert() send [{}] without a columns parameter.
This change stops insert and upsert with empty rows from sending an empty columns parameter, and tests cover both. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the change: bulk inserts or upserts whose rows have no keys no longer send a columns parameter. The raw summary confirms _setColumnsSearchParam now returns the base URL when the unio…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the change: bulk inserts or upserts whose rows have no keys no longer send a columns parameter. The raw summary confirms _setColumnsSearchParam now returns the base URL when the union of row keys is empty, and the objectives describe the fix for SDK-3079 where insert([{}]) and upsert([{}]) sent ?columns=. The title is specific and matches the main change.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
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
postgrestThis issue or pull request is related to postgrest
1 participant
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.
`insert([{}])` and `upsert([{}])` sent `?columns=`, which PostgREST rejects. Fixes SDK-3079.
Summary by CodeRabbit
Bug Fixes
columnsquery parameter, while preserving the empty row in the request body.Tests