postgrest-py icon indicating copy to clipboard operation
postgrest-py copied to clipboard

Implemement maybeSingle method

Open dreinon opened this issue 3 years ago • 4 comments
trafficstars

JS Implementation

dreinon avatar Feb 25 '22 01:02 dreinon

Hey @dreinon, can I work on this?

bariqhibat avatar May 01 '22 06:05 bariqhibat

How is the maybe_single method different from single?

anand2312 avatar May 01 '22 07:05 anand2312

How is the maybe_single method different from single?

The single method raises an error if the db response record count is different from 1 (if it doesn't find any records, it would raise an error). The maybeSingle method raises an error only if the db response record count is greater than 1, being 0 and 1 records valid.

dreinon avatar May 01 '22 07:05 dreinon

Thanks for the explanation! 😄

anand2312 avatar May 01 '22 11:05 anand2312