| 1 |
package gorm |
| 2 |
|
| 3 |
import ( |
| 4 |
"errors" |
| 5 |
|
| 6 |
"gorm.io/gorm/logger" |
| 7 |
) |
| 8 |
|
| 9 |
var ( |
| 10 |
// ErrRecordNotFound record not found error |
| 11 |
ErrRecordNotFound = logger.ErrRecordNotFound |
| 12 |
// ErrInvalidTransaction invalid transaction when you are trying to `Commit` or `Rollback` |
| 13 |
ErrInvalidTransaction = errors.New("invalid transaction") |
| 14 |
// ErrNotImplemented not implemented |
| 15 |
ErrNotImplemented = errors.New("not implemented") |
| 16 |
// ErrMissingWhereClause missing where clause |
| 17 |
ErrMissingWhereClause = errors.New("WHERE conditions required") |
| 18 |
// ErrUnsupportedRelation unsupported relations |
| 19 |
ErrUnsupportedRelation = errors.New("unsupported relations") |
| 20 |
// ErrPrimaryKeyRequired primary keys required |
| 21 |
ErrPrimaryKeyRequired = errors.New("primary key required") |
| 22 |
// ErrModelValueRequired model value required |
| 23 |
ErrModelValueRequired = errors.New("model value required") |
| 24 |
// ErrModelAccessibleFieldsRequired model accessible fields required |
| 25 |
ErrModelAccessibleFieldsRequired = errors.New("model accessible fields required") |
| 26 |
// ErrSubQueryRequired sub query required |
| 27 |
ErrSubQueryRequired = errors.New("sub query required") |
| 28 |
// ErrInvalidData unsupported data |
| 29 |
ErrInvalidData = errors.New("unsupported data") |
| 30 |
// ErrUnsupportedDriver unsupported driver |
| 31 |
ErrUnsupportedDriver = errors.New("unsupported driver") |
| 32 |
// ErrRegistered registered |
| 33 |
ErrRegistered = errors.New("registered") |
| 34 |
// ErrInvalidField invalid field |
| 35 |
ErrInvalidField = errors.New("invalid field") |
| 36 |
// ErrEmptySlice empty slice found |
| 37 |
ErrEmptySlice = errors.New("empty slice found") |
| 38 |
// ErrDryRunModeUnsupported dry run mode unsupported |
| 39 |
ErrDryRunModeUnsupported = errors.New("dry run mode unsupported") |
| 40 |
// ErrInvalidDB invalid db |
| 41 |
ErrInvalidDB = errors.New("invalid db") |
| 42 |
// ErrInvalidValue invalid value |
| 43 |
ErrInvalidValue = errors.New("invalid value, should be pointer to struct or slice") |
| 44 |
// ErrInvalidValueOfLength invalid values do not match length |
| 45 |
ErrInvalidValueOfLength = errors.New("invalid association values, length doesn't match") |
| 46 |
// ErrPreloadNotAllowed preload is not allowed when count is used |
| 47 |
ErrPreloadNotAllowed = errors.New("preload is not allowed when count is used") |
| 48 |
// ErrDuplicatedKey occurs when there is a unique key constraint violation |
| 49 |
ErrDuplicatedKey = errors.New("duplicated key not allowed") |
| 50 |
// ErrForeignKeyViolated occurs when there is a foreign key constraint violation |
| 51 |
ErrForeignKeyViolated = errors.New("violates foreign key constraint") |
| 52 |
// ErrCheckConstraintViolated occurs when there is a check constraint violation |
| 53 |
ErrCheckConstraintViolated = errors.New("violates check constraint") |
| 54 |
) |