Omit specify fields that you want to ignore when creating, updating and querying
(columns ...string)
| 175 | |
| 176 | // Omit specify fields that you want to ignore when creating, updating and querying |
| 177 | func (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 |
| 189 | func (db *DB) MapColumns(m map[string]string) (tx *DB) { |
nothing calls this directly
no test coverage detected