fix(postgrest): replace SCREAMING_SNAKE_CASE HTTP method constants with enum#1347
Merged
fix(postgrest): replace SCREAMING_SNAKE_CASE HTTP method constants with enum#1347
Conversation
…th enum Replace six file-private HTTP method string constants with a private _HttpMethod enum that has a .value getter for the uppercase string. Remove the ignore_for_file lint suppression and the unused _Nullable typedef (replaced with a _typeOf<T>() helper for the nullable type comparison at runtime). Closes: SDK-810 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mandarini
approved these changes
Apr 3, 2026
Vinzent03
requested changes
Apr 5, 2026
| String get value => name.toUpperCase(); | ||
| } | ||
|
|
||
| typedef _Nullable<T> = T?; |
Collaborator
There was a problem hiding this comment.
I'm really unsure about this change. I implemented that and was a strange required hack to work with nullability and generics. The tests do pass, but I'm not totally sure that case is covered. Is there any specific reason to change this here?
Keep the original _Nullable<T> hack for the nullable type comparison since it was an intentional workaround for Dart generics and its removal was not strictly required. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Reverted the |
Resolve conflict in postgrest_builder.dart: keep _HttpMethod enum comparison while adopting main's removal of _schema null assertion. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Vinzent03
approved these changes
Apr 6, 2026
The pre-commit dart formatter hook incidentally reformatted this file during the merge commit. Restore it to main's unmodified version since this PR only touches postgrest. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolve conflicts in postgrest_builder.dart: keep _HttpMethod enum comparisons while adopting main's execHeaders local copy, send-function pattern, and _executeWithRetry retry logic. Update _executeWithRetry signature to accept _HttpMethod instead of String. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
METHOD_*string constants with a_HttpMethodenum that exposes a.valuegetter returning the uppercase string// ignore_for_file: constant_identifier_namessuppression_Nullable<T>typedef, replacing its single use with a_typeOf<T>()helper for runtime nullable type comparisonChanges
postgrest_builder.dart: Adds_HttpMethodenum and_typeOf<T>()helper; removes constants, typedef, and lint suppression; updates all internal usagespostgrest_query_builder.dart: Updatesmethod:arguments from string constants to enum valuespostgrest_rpc_builder.dart: Samepostgrest_transform_builder.dart: SameRoot Cause
postgrest_builder.dartusedSCREAMING_SNAKE_CASEtop-level constants to represent HTTP method strings, requiring a file-level lint suppression (constant_identifier_names). These are private to the library and have no public API impact.Testing
dart analyze— no issuesdart test --name "Custom http client"— 4/4 pass (integration tests require a live PostgREST server not available in CI without Docker)Acceptance Criteria
constant_identifier_nameslint passes with no file-level suppression_Nullabletypedef removedLinear Issue
Closes: SDK-810
🤖 Generated with Claude Code
/take