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:
24
vendor/xorm.io/xorm/dialects/driver.go
generated
vendored
24
vendor/xorm.io/xorm/dialects/driver.go
generated
vendored
@@ -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...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user