Skip to content

Commit a5efce6

Browse files
fix: maybe_single with no matching rows returns None (#289)
1 parent ed6928a commit a5efce6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

postgrest/_async/request_builder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ async def execute(self) -> Optional[SingleAPIResponse]:
127127
try:
128128
r = await super().execute()
129129
except APIError as e:
130-
if e.details and "Results contain 0 rows" in e.details:
130+
if e.details and "The result contains 0 rows" in e.details:
131131
return None
132132
if not r:
133133
raise APIError(

postgrest/_sync/request_builder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def execute(self) -> Optional[SingleAPIResponse]:
127127
try:
128128
r = super().execute()
129129
except APIError as e:
130-
if e.details and "Results contain 0 rows" in e.details:
130+
if e.details and "The result contains 0 rows" in e.details:
131131
return None
132132
if not r:
133133
raise APIError(

0 commit comments

Comments
 (0)