// Query retrieves records with the specified offset and limit from the database.
Query retrieves records with the specified offset and limit from the database.
// Query retrieves records with the specified offset and limit from the database .
func (r MigrationRepository) Query(ctx context.Context, offset, limit uint) ([]migration.Log, error) {
	var items []migration.Log
	if limit == 0 {
		limit = MaxLIstLimit
	}
	err := r.db.DB().SelectContext(ctx, &items, "SELECT * FROM " + migration.TableName + " ORDER BY id LIMIT $1 OFFSET $2", limit, offset)
	if err != nil {
		if err == sql.ErrNoRows {
			return nil, apperror.ErrNotFound
		}
		return nil, errors.Wrapf(apperror.ErrInternal, "MigrationRepository.Query error: %v", err)
	}
	return items, nil
}
func ( r MigrationRepository ) Query ( ctx context . Context , offset , limit uint ) ( [ ] migration . Log , error ) { var items [ ] migration . Log if limit == 0 { limit = MaxLIstLimit } err := r . db . DB ( ) . SelectContext ( ctx , & items , " " + migration . TableName + " " , limit , offset ) if err != nil { if err == sql . ErrNoRows { return nil , apperror . ErrNotFound } return nil , errors . Wrapf ( apperror . ErrInternal , " " , err ) } return items , nil }
Query retrieves records with the specified offset and limit from the database.
Query retrieves records with the specified offset and limit from the database .