From 0ccc4802225b22ecc54a023949643ed609331532 Mon Sep 17 00:00:00 2001 From: Auke van Slooten Date: Tue, 11 May 2021 15:28:27 +0200 Subject: [PATCH] generator result handler now uses a cursor by default removed the incorrect yield statement --- src/store/ResultHandlers.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/store/ResultHandlers.php b/src/store/ResultHandlers.php index 892d551..c00c781 100644 --- a/src/store/ResultHandlers.php +++ b/src/store/ResultHandlers.php @@ -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);