1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 18:50:50 +00:00

[Fix-Issue-3991] Fix Read with SQLite not supporting SELECT FOR UPDATE syntax

This commit is contained in:
Yang, Gao 2020-05-15 17:36:01 +08:00
parent 8f3d1c5f42
commit 8055357576

View File

@ -17,6 +17,8 @@ package orm
import (
"database/sql"
"fmt"
"reflect"
"time"
)
// sqlite operators.
@ -66,6 +68,11 @@ type dbBaseSqlite struct {
var _ dbBaser = new(dbBaseSqlite)
// override base db read for update behavior as SQlite does not support syntax
func (d *dbBaseSqlite) Read(q dbQuerier, mi *modelInfo, ind reflect.Value, tz *time.Location, cols []string, isForUpdate bool) error {
return d.dbBase.Read(q, mi, ind, tz, cols, false)
}
// get sqlite operator.
func (d *dbBaseSqlite) OperatorSQL(operator string) string {
return sqliteOperators[operator]