Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: limit imports #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

atymic
Copy link
Contributor

@atymic atymic commented Dec 27, 2021

No description provided.

@atymic
Copy link
Contributor Author

atymic commented Jan 31, 2022

cc @rap2hpoutre

@klimov-paul
Copy link

This does not seem right: if you need to limit the number of exported rows, you should apply limit at the DB query instance instead.

function usersGenerator() {
    foreach (User::query()->limit(100)->cursor() as $user) {
        yield $user;
    }
}

(new FastExcel(usersGenerator()))->export('test.xlsx');

@atymic
Copy link
Contributor Author

atymic commented Feb 8, 2022

This does not seem right: if you need to limit the number of exported rows, you should apply limit at the DB query instance instead.

This is for imports, not exports :)

@klimov-paul
Copy link

OK then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants