Skip to content

Outputting large amounts of rows #89

@asgraf

Description

@asgraf

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions