Skip to content

fix(postgrest): fix maybe_single#1424

Merged
o-santi merged 2 commits intomainfrom
postgrest/fix-maybe-single
Mar 20, 2026
Merged

fix(postgrest): fix maybe_single#1424
o-santi merged 2 commits intomainfrom
postgrest/fix-maybe-single

Conversation

@o-santi
Copy link
Contributor

@o-santi o-santi commented Mar 20, 2026

What kind of change does this PR introduce?

Do not ask for maybe_single to return a single object. Instead, return a list, and manually ensure that it only has one object.

This removes the need to parse the error message to understand if the error was due to an actual error or a missing row.

Fixes long standing error #1207.

Related PR: PostgREST/postgrest#4744

do not ask for maybe_single to return a single object. instead, return
a list, and manually ensure that it only has one object.

this removes the need to parse the error message to understand if the
error was due to an actual error or a missing row.
@o-santi o-santi changed the title fix(postgrest): fix maybe single fix(postgrest): fix maybe_single Mar 20, 2026
Copy link
Contributor

@mandarini mandarini left a comment

Choose a reason for hiding this comment

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

Nice improvement. Will do similar in js

@o-santi o-santi merged commit c7f8f13 into main Mar 20, 2026
40 checks passed
@o-santi o-santi deleted the postgrest/fix-maybe-single branch March 20, 2026 14:26
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