1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 02:08:36 +00:00

Upgrade xorm to v1.0.0 (#10646)

* Upgrade xorm to v1.0.0

* small nit

* Fix tests

* Update xorm

* Update xorm

* fix go.sum

* fix test

* Fix bug when dump

* Fix bug

* update xorm to latest

* Fix migration test

* update xorm to latest

* Fix import order

* Use xorm tag
This commit is contained in:
Lunny Xiao
2020-03-22 23:12:55 +08:00
committed by GitHub
parent dcaa5643d7
commit c61b902538
154 changed files with 7195 additions and 5962 deletions

21
vendor/xorm.io/xorm/session_cols.go generated vendored
View File

@@ -9,10 +9,10 @@ import (
"strings"
"time"
"xorm.io/core"
"xorm.io/xorm/schemas"
)
func setColumnInt(bean interface{}, col *core.Column, t int64) {
func setColumnInt(bean interface{}, col *schemas.Column, t int64) {
v, err := col.ValueOf(bean)
if err != nil {
return
@@ -27,7 +27,7 @@ func setColumnInt(bean interface{}, col *core.Column, t int64) {
}
}
func setColumnTime(bean interface{}, col *core.Column, t time.Time) {
func setColumnTime(bean interface{}, col *schemas.Column, t time.Time) {
v, err := col.ValueOf(bean)
if err != nil {
return
@@ -44,7 +44,7 @@ func setColumnTime(bean interface{}, col *core.Column, t time.Time) {
}
}
func getFlagForColumn(m map[string]bool, col *core.Column) (val bool, has bool) {
func getFlagForColumn(m map[string]bool, col *schemas.Column) (val bool, has bool) {
if len(m) == 0 {
return false, false
}
@@ -63,19 +63,6 @@ func getFlagForColumn(m map[string]bool, col *core.Column) (val bool, has bool)
return false, false
}
func col2NewCols(columns ...string) []string {
newColumns := make([]string, 0, len(columns))
for _, col := range columns {
col = strings.Replace(col, "`", "", -1)
col = strings.Replace(col, `"`, "", -1)
ccols := strings.Split(col, ",")
for _, c := range ccols {
newColumns = append(newColumns, strings.TrimSpace(c))
}
}
return newColumns
}
// Incr provides a query string like "count = count + 1"
func (session *Session) Incr(column string, arg ...interface{}) *Session {
session.statement.Incr(column, arg...)