Should operations be returning sql.ErrNoRows, if they return a pointer anyway? #1237
-
|
I believe a version of this question has been asked in the past. Basically, the premise is this - assuming that I presume that it is impossible to add this check by default because of the backwards compatibility, but could this be done with a configuration option? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
If asking for a single record, it is an error if none exists, but if asking for a list, you can get an empty list. This is to match the behavior of the standard library.
So in SQLBoiler, |
Beta Was this translation helpful? Give feedback.
If asking for a single record, it is an error if none exists, but if asking for a list, you can get an empty list.
This is to match the behavior of the standard library.
QueryandQueryContextdo not returnsql.ErrNoRowsQueryRowandQueryRowContextreturnsql.ErrNoRowsSo in SQLBoiler,
Find,Onereturnsql.ErrNoRowswhileAlldoes not.