Merge 1ab3bc5316bb90ef9286092e57edf1c160bdde4a into f6260a00852946a10a57e8bb9f505f19bc9389b7
This commit is contained in:
commit
b13d48ef16
10
main.go
10
main.go
@ -530,11 +530,21 @@ func (s *DB) NewRecord(value interface{}) bool {
|
||||
|
||||
// RecordNotFound check if returning ErrRecordNotFound error
|
||||
func (s *DB) RecordNotFound() bool {
|
||||
if s.search.raw {
|
||||
rows, err := s.Rows()
|
||||
defer rows.Close()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return !rows.Next()
|
||||
}
|
||||
|
||||
for _, err := range s.GetErrors() {
|
||||
if err == ErrRecordNotFound {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user