MCPcopy
hub / github.com/go-gorm/gorm / Omit

Method Omit

chainable_api.go:177–186  ·  view source on GitHub ↗

Omit specify fields that you want to ignore when creating, updating and querying

(columns ...string)

Source from the content-addressed store, hash-verified

175
176// Omit specify fields that you want to ignore when creating, updating and querying
177func (db *DB) Omit(columns ...string) (tx *DB) {
178 tx = db.getInstance()
179
180 if len(columns) == 1 && strings.ContainsRune(columns[0], ',') {
181 tx.Statement.Omits = strings.FieldsFunc(columns[0], utils.IsInvalidDBNameChar)
182 } else {
183 tx.Statement.Omits = columns
184 }
185 return
186}
187
188// MapColumns modify the column names in the query results to facilitate align to the corresponding structural fields
189func (db *DB) MapColumns(m map[string]string) (tx *DB) {

Callers

nothing calls this directly

Calls 1

getInstanceMethod · 0.95

Tested by

no test coverage detected