mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Upgrade xorm to v1.0.2 (#11900)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
16
vendor/xorm.io/xorm/schemas/column.go
generated
vendored
16
vendor/xorm.io/xorm/schemas/column.go
generated
vendored
@@ -5,8 +5,10 @@
|
||||
package schemas
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
@@ -115,3 +117,17 @@ func (col *Column) ValueOfV(dataStruct *reflect.Value) (*reflect.Value, error) {
|
||||
|
||||
return &fieldValue, nil
|
||||
}
|
||||
|
||||
// ConvertID converts id content to suitable type according column type
|
||||
func (col *Column) ConvertID(sid string) (interface{}, error) {
|
||||
if col.SQLType.IsNumeric() {
|
||||
n, err := strconv.ParseInt(sid, 10, 64)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return n, nil
|
||||
} else if col.SQLType.IsText() {
|
||||
return sid, nil
|
||||
}
|
||||
return nil, errors.New("not supported")
|
||||
}
|
||||
|
Reference in New Issue
Block a user