Skip to content

Conversation

@grdsdev
Copy link
Contributor

@grdsdev grdsdev commented Sep 22, 2025

Summary

  • Implement maxAffected method in PostgrestTransformBuilder for PostgREST v13+ row limit enforcement
  • Add comprehensive tests covering UPDATE, DELETE, RPC, and SELECT operations
  • Remove method validation to allow flexible usage with documentation notes

Features

  • Sets handling=strict and max-affected=<value> headers for row limit enforcement
  • Works with PATCH, DELETE methods and RPC calls (as documented)
  • Includes test for calling method multiple times (last value wins)
  • No runtime validation - relies on documentation for proper usage

Test plan

  • Test maxAffected on UPDATE operations
  • Test maxAffected on DELETE operations
  • Test maxAffected on RPC calls
  • Test maxAffected on SELECT (demonstrates no validation)
  • Test calling maxAffected multiple times
  • Verify correct Prefer headers are set in all cases

🤖 Generated with Claude Code

Add maxAffected method to PostgrestTransformBuilder that sets handling=strict
and max-affected headers for PostgREST v13+ row limit enforcement on PATCH,
DELETE, and RPC operations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@grdsdev grdsdev requested a review from a team September 22, 2025 08:58
@grdsdev grdsdev merged commit 78fbd8a into main Sep 22, 2025
19 checks passed
@grdsdev grdsdev deleted the guilherme/clibs-378-supabase-swift-implement-maxaffected-method branch September 22, 2025 12:39
supabase-releaser bot pushed a commit that referenced this pull request Sep 22, 2025
## [2.33.0](v2.32.0...v2.33.0) (2025-09-22)

### Features

* **postgrest:** implement maxAffected method for row limit enforcement ([#795](#795)) ([78fbd8a](78fbd8a))
@supabase-releaser
Copy link

🎉 This issue has been resolved in version 2.33.0 🎉

The release is available on GitHub release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants