Esempio n. 1
0
 /**
  * Fetch all results for the supplied SQL statement using a PHP generator.
  *
  * This approach uses less memory, but the result set has a forward-only cursor.
  *
  * @param string|\Dewdrop\Db\Select $sql
  * @param array $bind
  * @param string $fetchMode
  * @return \Generator
  */
 public function fetchAllWithGenerator($sql, $bind = [], $fetchMode = null)
 {
     foreach ($this->driver->fetchAllWithGenerator($sql, $bind, $fetchMode) as $row) {
         (yield $row);
     }
 }