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

Outputting large amounts of rows #89

Open
asgraf opened this issue May 15, 2018 · 1 comment
Open

Outputting large amounts of rows #89

asgraf opened this issue May 15, 2018 · 1 comment

Comments

@asgraf
Copy link

asgraf commented May 15, 2018

I would like to generate really big csv files with large amounts of rows.

public function export()
{
    $this->viewBuilder()->className('CsvView.Csv');
    $milionsOfRows = $this->SomeBigTable->find()->enableBufferedResults(false)->all();

    $this->set('data',$milionsOfRows);
    $this->set('_serialize','data');
}

Currently this plugin generates complete csv content before outputting it to the browser.
This can cause slowndowns or running out of memory when dealing with big number of rows.
I think it would be good idea to stream csv output instead (and flush() it every 100 rows)

@josegonzalez
Copy link
Member

Looks like this is possible as shown here.

Would you be interested in creating a pull request? For large responses, I normally generate on the backend and provide a notification to the user that their response is ready, rather than generate on the fly.
What I'm trying to say is this isn't a problem I have in my applications, so I am unlikely to work on a fix.

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

No branches or pull requests

3 participants