MCPcopy Create free account
hub / github.com/go-pg/pg / WithModel

Method WithModel

orm/format.go:193–204  ·  view source on GitHub ↗
(model interface{})

Source from the content-addressed store, hash-verified

191}
192
193func (f *Formatter) WithModel(model interface{}) *Formatter {
194 switch model := model.(type) {
195 case TableModel:
196 return f.WithTableModel(model)
197 case *Query:
198 return f.WithTableModel(model.tableModel)
199 case QueryCommand:
200 return f.WithTableModel(model.Query().tableModel)
201 default:
202 panic(fmt.Errorf("pg: unsupported model %T", model))
203 }
204}
205
206func (f *Formatter) setParam(param string, value interface{}) {
207 if f.namedParams == nil {

Callers 3

appendQueryFunction · 0.80
queryStringFunction · 0.80
TestQueryFormatQueryFunction · 0.80

Calls 2

WithTableModelMethod · 0.95
QueryMethod · 0.65

Tested by 2

queryStringFunction · 0.64
TestQueryFormatQueryFunction · 0.64