MCPcopy Index your code
hub / github.com/micro/go-micro / buildUpdate

Function buildUpdate

model/sqlite/sqlite.go:301–314  ·  view source on GitHub ↗
(schema *model.Schema, fields map[string]any)

Source from the content-addressed store, hash-verified

299}
300
301func buildUpdate(schema *model.Schema, fields map[string]any) (string, []any) {
302 var setClauses []string
303 var values []any
304 for _, f := range schema.Fields {
305 if f.IsKey {
306 continue
307 }
308 if v, ok := fields[f.Column]; ok {
309 setClauses = append(setClauses, fmt.Sprintf("%q = ?", f.Column))
310 values = append(values, v)
311 }
312 }
313 return strings.Join(setClauses, ", "), values
314}
315
316func buildWhere(filters []model.Filter) (string, []any) {
317 var clauses []string

Callers 1

UpdateMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…