mirror of
https://github.com/gohouse/gorose.git
synced 2025-12-24 12:47:55 +08:00
driver
This commit is contained in:
@@ -515,7 +515,7 @@ func (d Driver) toSqlInsert(c *builder.Context, data any, insertCase builder.Typ
|
||||
return
|
||||
}
|
||||
//sql4prepare = NamedSprintf(":insert INTO :tables (:fields) VALUES :placeholder :onDuplicateKey", insert, tables, strings.Join(fields, ","), strings.Join(valuesPlaceholderArr, ","), onDuplicateKey)
|
||||
sql4prepare = NamedSprintf("%s INTO %s (%s) VALUES %s %s", insert, tables, strings.Join(fields, ","), strings.Join(valuesPlaceholderArr, ","), onDuplicateKey)
|
||||
sql4prepare = fmt.Sprintf("%s INTO %s (%s) VALUES %s %s", insert, tables, strings.Join(fields, ","), strings.Join(valuesPlaceholderArr, ","), onDuplicateKey)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -565,6 +565,6 @@ func (d Driver) toSqlDelete(c *builder.Context) (sql4prepare string, values []an
|
||||
}
|
||||
values = append(values, binds...)
|
||||
//sql4prepare = NamedSprintf("DELETE FROM :tables :wheres", tables, wheres)
|
||||
sql4prepare = NamedSprintf("DELETE FROM %s %s", tables, wheres)
|
||||
sql4prepare = fmt.Sprintf("DELETE FROM %s %s", tables, wheres)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ func jsonLog(t *testing.T, data any) {
|
||||
t.Logf("json data: %s", marshal)
|
||||
}
|
||||
|
||||
func Map[Data any, Datas ~[]Data, Result any](datas Datas, mapper func(Data) Result) []Result {
|
||||
func Map[Data any, Result any](datas []Data, mapper func(Data) Result) []Result {
|
||||
results := make([]Result, 0, len(datas))
|
||||
for _, data := range datas {
|
||||
results = append(results, mapper(data))
|
||||
|
||||
Reference in New Issue
Block a user