Find finds all records matching given conditions conds
(dest interface{}, conds ...interface{})
| 172 | |
| 173 | // Find finds all records matching given conditions conds |
| 174 | func (db *DB) Find(dest interface{}, conds ...interface{}) (tx *DB) { |
| 175 | tx = db.getInstance() |
| 176 | if len(conds) > 0 { |
| 177 | if exprs := tx.Statement.BuildCondition(conds[0], conds[1:]...); len(exprs) > 0 { |
| 178 | tx.Statement.AddClause(clause.Where{Exprs: exprs}) |
| 179 | } |
| 180 | } |
| 181 | tx.Statement.Dest = dest |
| 182 | return tx.callbacks.Query().Execute(tx) |
| 183 | } |
| 184 | |
| 185 | // FindInBatches finds all records in batches of batchSize |
| 186 | func (db *DB) FindInBatches(dest interface{}, batchSize int, fc func(tx *DB, batch int) error) *DB { |
nothing calls this directly
no test coverage detected