Skip to content

feat(postgrest): add structured execution results - #1550

Open
ragbendra wants to merge 1 commit into
supabase:mainfrom
ragbendra:feat/postgrest-structured-results
Open

feat(postgrest): add structured execution results#1550
ragbendra wants to merge 1 commit into
supabase:mainfrom
ragbendra:feat/postgrest-structured-results

Conversation

@ragbendra

Copy link
Copy Markdown

Summary

Adds an opt-in, non-throwing execution API that returns structured results similar to the Supabase JavaScript client.

Relates to #1548

What changed

Added execute_result() to PostgREST request builders.

Successful responses return:

ExecuteResult(
    type="success",
    data=...,
    error=None,
    status=200,
    count=...,
)

Failed responses return:

ExecuteResult(
    type="error",
    data=None,
    error={...},
    status=400,
)
  • successful requests still return APIResponse
  • failed requests still raise APIError

The new API supports normal queries, single(), maybe_single(), and synchronous and asynchronous clients.

Additional changes

  • Added the ExecuteResult response model.
  • Exported it from the postgrest package.
  • Re-exported it through supabase.
  • Added response documentation.
  • Added sync and async tests covering successful responses, errors, HTTP status codes, empty responses, single(), and maybe_single().

Validation

  • Ruff: passed
  • Mypy: passed
  • Public export validation: passed
  • Focused sync/async tests: 14 passed

The complete integration suite was not completed locally. The focused tests and static checks pass, and the remaining validation can be completed by CI.

@ragbendra
ragbendra requested review from a team and o-santi as code owners July 27, 2026 05:37
Copilot AI review requested due to automatic review settings July 27, 2026 05:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants