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

Method AppendParam

orm/model_table_struct.go:61–89  ·  view source on GitHub ↗
(fmter QueryFormatter, b []byte, name string)

Source from the content-addressed store, hash-verified

59}
60
61func (m *structTableModel) AppendParam(fmter QueryFormatter, b []byte, name string) ([]byte, bool) {
62 b, ok := m.table.AppendParam(b, m.strct, name)
63 if ok {
64 return b, true
65 }
66
67 switch name {
68 case "TableName":
69 b = fmter.FormatQuery(b, string(m.table.SQLName))
70 return b, true
71 case "TableAlias":
72 b = append(b, m.table.Alias...)
73 return b, true
74 case "TableColumns":
75 b = appendColumns(b, m.table.Alias, m.table.Fields)
76 return b, true
77 case "Columns":
78 b = appendColumns(b, "", m.table.Fields)
79 return b, true
80 case "TablePKs":
81 b = appendColumns(b, m.table.Alias, m.table.PKs)
82 return b, true
83 case "PKs":
84 b = appendColumns(b, "", m.table.PKs)
85 return b, true
86 }
87
88 return b, false
89}
90
91func (m *structTableModel) Root() reflect.Value {
92 return m.root

Callers

nothing calls this directly

Calls 3

appendColumnsFunction · 0.85
AppendParamMethod · 0.65
FormatQueryMethod · 0.65

Tested by

no test coverage detected