add query hint support
This commit is contained in:
parent
8b07437717
commit
5d759aa0b2
@ -60,6 +60,11 @@ func queryCallback(scope *Scope) {
|
|||||||
|
|
||||||
if !scope.HasError() {
|
if !scope.HasError() {
|
||||||
scope.db.RowsAffected = 0
|
scope.db.RowsAffected = 0
|
||||||
|
|
||||||
|
if str, ok := scope.Get("gorm:query_hint"); ok {
|
||||||
|
scope.SQL = addExtraSpaceIfExist(fmt.Sprint(str)) + scope.SQL
|
||||||
|
}
|
||||||
|
|
||||||
if str, ok := scope.Get("gorm:query_option"); ok {
|
if str, ok := scope.Get("gorm:query_option"); ok {
|
||||||
scope.SQL += addExtraSpaceIfExist(fmt.Sprint(str))
|
scope.SQL += addExtraSpaceIfExist(fmt.Sprint(str))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user