1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Upgrade xorm to v1.2.2 (#16663)

* Upgrade xorm to v1.2.2

* Change the Engine interface to match xorm v1.2.2
This commit is contained in:
Lunny Xiao
2021-08-13 07:11:42 +08:00
committed by GitHub
parent 5fbccad906
commit 7224cfc578
134 changed files with 42889 additions and 5428 deletions

View File

@@ -5,12 +5,30 @@
package dialects
import (
"database/sql"
"fmt"
"time"
"xorm.io/xorm/core"
)
// ScanContext represents a context when Scan
type ScanContext struct {
DBLocation *time.Location
UserLocation *time.Location
}
// DriverFeatures represents driver feature
type DriverFeatures struct {
SupportReturnInsertedID bool
}
// Driver represents a database driver
type Driver interface {
Parse(string, string) (*URI, error)
Features() *DriverFeatures
GenScanResult(string) (interface{}, error) // according given column type generating a suitable scan interface
Scan(*ScanContext, *core.Rows, []*sql.ColumnType, ...interface{}) error
}
var (
@@ -59,3 +77,9 @@ func OpenDialect(driverName, connstr string) (Dialect, error) {
return dialect, nil
}
type baseDriver struct{}
func (b *baseDriver) Scan(ctx *ScanContext, rows *core.Rows, types []*sql.ColumnType, v ...interface{}) error {
return rows.Scan(v...)
}