-
-
Notifications
You must be signed in to change notification settings - Fork 160
feat: postgrest 13 add maxaffected in client libraries #619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: avallete/psql-436-feedback-request-postgrest-js-and-postgrest-v13-integration
Are you sure you want to change the base?
Conversation
…tgrest-v13-integration' into avallete/psql-372-postgrest-add-maxaffected-in-client-libraries
.maxAffected(2) | ||
const { error } = result | ||
expect(error).toBeDefined() | ||
expect(error?.message).toBe('Query result exceeds max-affected preference constraint') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just matching the PostgREST error code? (PGRST124
, ref)
This would allow us to change the error message without causing a test failure later. Right now the error message seems a bit specific to postgREST ("preference constraint" could be removed)
.select() | ||
|
||
expect(error).toBeDefined() | ||
expect(error?.message).toBe('Query result exceeds max-affected preference constraint') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto here, only match error code if possible.
@@ -0,0 +1,64 @@ | |||
export class HeaderManager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the Headers API instead? Should be available on both web and Node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea though and we should move to using that vs. plain objects/Record
s
* | ||
* @param value - The maximum number of rows that can be affected | ||
*/ | ||
maxAffected( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this to PostgrestTransformBuilder
since this doesn't do horizontal filtering, but rather an assertion a la .single()
What kind of change does this PR introduce?