Limit specify the number of records to be retrieved Limit conditions can be cancelled by using `Limit(-1)`. // retrieve 3 users db.Limit(3).Find(&users) // retrieve 3 users into users1, and all users into users2 db.Limit(3).Find(&users1).Limit(-1).Find(&users2)
(limit int)
| 341 | // // retrieve 3 users into users1, and all users into users2 |
| 342 | // db.Limit(3).Find(&users1).Limit(-1).Find(&users2) |
| 343 | func (db *DB) Limit(limit int) (tx *DB) { |
| 344 | tx = db.getInstance() |
| 345 | tx.Statement.AddClause(clause.Limit{Limit: &limit}) |
| 346 | return |
| 347 | } |
| 348 | |
| 349 | // Offset specify the number of records to skip before starting to return the records |
| 350 | // |
no test coverage detected