Skip to content

Commit

Permalink
generator result handler now uses a cursor by default
Browse files Browse the repository at this point in the history
removed the incorrect yield statement
  • Loading branch information
poef committed May 11, 2021
1 parent 00a1fb4 commit 0ccc480
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/store/ResultHandlers.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ public static function getDBHandler($db)
public static function getDBGeneratorHandler($db)
{
return function($query, $args) use ($db) {
$q = $db->prepare('select * from nodes where '.$query);
$q = $db->prepare('select * from nodes where '.$query, array(
\PDO::ATTR_CURSOR => \PDO::CURSOR_SCROLL
));
$result = $q->execute($args);
$data = $q->fetch(\PDO::FETCH_ASSOC);
if (!$data) {
return $data;
}
while ($data) {
$value = (object) $data;
$value->data = json_decode($value->data);
Expand Down

0 comments on commit 0ccc480

Please sign in to comment.