MCPcopy
hub / github.com/geektutu/7days-golang / Set

Method Set

gee-orm/day5-hooks/clause/clause.go:30–38  ·  view source on GitHub ↗

Set adds a sub clause of specific type

(name Type, vars ...interface{})

Source from the content-addressed store, hash-verified

28
29// Set adds a sub clause of specific type
30func (c *Clause) Set(name Type, vars ...interface{}) {
31 if c.sql == nil {
32 c.sql = make(map[Type]string)
33 c.sqlVars = make(map[Type][]interface{})
34 }
35 sql, vars := generators[name](vars...)
36 c.sql[name] = sql
37 c.sqlVars[name] = vars
38}
39
40// Build generate the final SQL and SQLVars
41func (c *Clause) Build(orders ...Type) (string, []interface{}) {

Callers 15

TestClause_SetFunction · 0.95
testSelectFunction · 0.95
testUpdateFunction · 0.95
testDeleteFunction · 0.95
TestMethodType_CallFunction · 0.45
ServeHTTPMethod · 0.45
newReplyvMethod · 0.45
BroadcastMethod · 0.45
TestMethodType_CallFunction · 0.45
ServeHTTPMethod · 0.45
newReplyvMethod · 0.45
TestMethodType_CallFunction · 0.45

Calls

no outgoing calls

Tested by 9

TestClause_SetFunction · 0.76
testSelectFunction · 0.76
testUpdateFunction · 0.76
testDeleteFunction · 0.76
TestMethodType_CallFunction · 0.36
TestMethodType_CallFunction · 0.36
TestMethodType_CallFunction · 0.36
TestMethodType_CallFunction · 0.36
TestMethodType_CallFunction · 0.36