修复使用 postgres 数据库时,位置参数重复,导致参数与值不对应的问题。 (#960)
* 修复使用 postgres 数据库时,位置参数重复,导致参数与值不对应的问题。 * 修复使用 postgres 数据库时,位置参数重复,导致参数与值不对应的问题。 Co-authored-by: toven <toven@advan.onaliyun.com>
This commit is contained in:
@@ -125,7 +125,7 @@ func RawFieldNames(in interface{}, postgresSql ...bool) []string {
|
||||
func PostgreSqlJoin(elems []string) string {
|
||||
b := new(strings.Builder)
|
||||
for index, e := range elems {
|
||||
b.WriteString(fmt.Sprintf("%s = $%d, ", e, index+1))
|
||||
b.WriteString(fmt.Sprintf("%s = $%d, ", e, index+2))
|
||||
}
|
||||
|
||||
if b.Len() == 0 {
|
||||
|
||||
Reference in New Issue
Block a user