You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the API only supports buffering the whole result set in memory. This makes sense for smaller result sets as working with an in-memory data structure with some dozens or hundreds of records works perfectly fine.
However, when processing larger result sets with hundreds or thousands of records, it would make sense to use a streaming approach so that one is no longer limited by memory in how many records can be processed.
I have prepared a working prototype that works really well. This will involve some minor BC breaks and also requires some API cleanup first, so I'm putting this out here as a heads-up.
Eventual API will use ReactPHP's existing stream API and could look something like this:
$stream = $db->stream('SELECT * FROM users');
$stream->on('data', function ($row) {
var_dump($row);
});
$stream->on('end', function () {
echo 'DONE' . PHP_EOL;
});
The text was updated successfully, but these errors were encountered:
Currently, the API only supports buffering the whole result set in memory. This makes sense for smaller result sets as working with an in-memory data structure with some dozens or hundreds of records works perfectly fine.
However, when processing larger result sets with hundreds or thousands of records, it would make sense to use a streaming approach so that one is no longer limited by memory in how many records can be processed.
I have prepared a working prototype that works really well. This will involve some minor BC breaks and also requires some API cleanup first, so I'm putting this out here as a heads-up.
Eventual API will use ReactPHP's existing stream API and could look something like this:
The text was updated successfully, but these errors were encountered: