mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:30:56 +00:00
Merge pull request #3992 from maxshine/fix-3991
[Fix-Issue-3991] Fix Read with SQLite not supporting SELECT FOR UPDAT…
This commit is contained in:
commit
ae15b54f83
@ -17,6 +17,8 @@ package orm
|
|||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"reflect"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// sqlite operators.
|
// sqlite operators.
|
||||||
@ -66,6 +68,14 @@ type dbBaseSqlite struct {
|
|||||||
|
|
||||||
var _ dbBaser = new(dbBaseSqlite)
|
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 {
|
||||||
|
if isForUpdate {
|
||||||
|
DebugLog.Println("[WARN] SQLite does not support SELECT FOR UPDATE query, isForUpdate param is ignored and always as false to do the work")
|
||||||
|
}
|
||||||
|
return d.dbBase.Read(q, mi, ind, tz, cols, false)
|
||||||
|
}
|
||||||
|
|
||||||
// get sqlite operator.
|
// get sqlite operator.
|
||||||
func (d *dbBaseSqlite) OperatorSQL(operator string) string {
|
func (d *dbBaseSqlite) OperatorSQL(operator string) string {
|
||||||
return sqliteOperators[operator]
|
return sqliteOperators[operator]
|
||||||
|
Loading…
Reference in New Issue
Block a user