Set adds a sub clause of specific type
(name Type, vars ...interface{})
| 28 | |
| 29 | // Set adds a sub clause of specific type |
| 30 | func (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 |
| 41 | func (c *Clause) Build(orders ...Type) (string, []interface{}) { |
no outgoing calls