2016-11-04 03:46:01 +05:30
|
|
|
// Copyright 2015 The Xorm Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package xorm
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
2018-07-20 07:40:17 +05:30
|
|
|
"fmt"
|
2016-11-04 03:46:01 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2017-01-03 13:50:28 +05:30
|
|
|
// ErrParamsType params error
|
|
|
|
ErrParamsType = errors.New("Params type error")
|
|
|
|
// ErrTableNotFound table not found error
|
2018-07-20 07:40:17 +05:30
|
|
|
ErrTableNotFound = errors.New("Table not found")
|
2017-01-03 13:50:28 +05:30
|
|
|
// ErrUnSupportedType unsupported error
|
|
|
|
ErrUnSupportedType = errors.New("Unsupported type error")
|
2018-07-20 07:40:17 +05:30
|
|
|
// ErrNotExist record does not exist error
|
|
|
|
ErrNotExist = errors.New("Record does not exist")
|
2017-01-03 13:50:28 +05:30
|
|
|
// ErrCacheFailed cache failed error
|
|
|
|
ErrCacheFailed = errors.New("Cache failed")
|
|
|
|
// ErrNeedDeletedCond delete needs less one condition error
|
2018-07-20 07:40:17 +05:30
|
|
|
ErrNeedDeletedCond = errors.New("Delete action needs at least one condition")
|
2017-01-03 13:50:28 +05:30
|
|
|
// ErrNotImplemented not implemented
|
|
|
|
ErrNotImplemented = errors.New("Not implemented")
|
2018-01-27 20:50:59 +05:30
|
|
|
// ErrConditionType condition type unsupported
|
2018-07-20 07:40:17 +05:30
|
|
|
ErrConditionType = errors.New("Unsupported condition type")
|
2019-06-23 20:52:43 +05:30
|
|
|
// ErrUnSupportedSQLType parameter of SQL is not supported
|
|
|
|
ErrUnSupportedSQLType = errors.New("unsupported sql type")
|
2016-11-04 03:46:01 +05:30
|
|
|
)
|
2018-07-20 07:40:17 +05:30
|
|
|
|
|
|
|
// ErrFieldIsNotExist columns does not exist
|
|
|
|
type ErrFieldIsNotExist struct {
|
|
|
|
FieldName string
|
|
|
|
TableName string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e ErrFieldIsNotExist) Error() string {
|
|
|
|
return fmt.Sprintf("field %s is not valid on table %s", e.FieldName, e.TableName)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrFieldIsNotValid is not valid
|
|
|
|
type ErrFieldIsNotValid struct {
|
|
|
|
FieldName string
|
|
|
|
TableName string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e ErrFieldIsNotValid) Error() string {
|
|
|
|
return fmt.Sprintf("field %s is not valid on table %s", e.FieldName, e.TableName)
|
|
|
|
}
|