From 0caca1a6f9048f916293ef558c9b8d0b772de53e Mon Sep 17 00:00:00 2001 From: Gerhard Gruber Date: Wed, 8 Sep 2021 09:01:03 +0200 Subject: [PATCH] Remove WHERE word --- expression_ext.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expression_ext.go b/expression_ext.go index a0fb0021..cafd87e7 100644 --- a/expression_ext.go +++ b/expression_ext.go @@ -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)