Remove WHERE word

This commit is contained in:
Gerhard Gruber 2021-09-08 09:01:03 +02:00
parent 099a4048ae
commit 0caca1a6f9

View File

@ -468,7 +468,7 @@ func (db *DB) GetSQL() string {
func (db *DB) GetSQLWhereClause() string {
scope := db.NewScope(db.Value)
stmt := strings.ReplaceAll(scope.CombinedConditionSql(), "$$$", "?")
stmt := strings.Replace(strings.ReplaceAll(scope.whereSQL(), "$$$", "?"), "WHERE", "", 1)
for _, arg := range scope.SQLVars {
stmt = strings.Replace(stmt, "?", "'"+escape(fmt.Sprintf("%v", arg))+"'", 1)