proposal
We should modify the unspecific error fmt.Errorf("OperXXX has no rows") into the certain error type sql.ErrNoRows in the most FetchXXX funcs.
And wraps this error with fmt.Errorf("DBTable: %w", sql.ErrNoRows)
advantages
With this patch , we can simply use errors.Is(err,sql.ErrNoRows) to check if it is a no rows error in the upstream codes.
proposal
We should modify the unspecific error
fmt.Errorf("OperXXX has no rows")into the certain error type sql.ErrNoRows in the most FetchXXX funcs.And wraps this error with
fmt.Errorf("DBTable: %w", sql.ErrNoRows)advantages
With this patch , we can simply use
errors.Is(err,sql.ErrNoRows)to check if it is a no rows error in the upstream codes.