Closed oderayi closed 6 years ago
Hey there,
You currently can use this:
R::getToolbox()->getDatabaseAdapter()->getCursor( $sql, $bindings );
Example:
$cursor = R::getToolbox()->getDatabaseAdapter()->getCursor( 'SELECT * FROM users WHERE name LIKE ?', [ 'A%' ] );
while ($row = $cursor->getNextItem()) {
// Do your thing...
}
It would be good to have a direct function for this in the facade I think.
In RedBeanPHP, the only way to work with cursor is through
findCollection
, butfindCollection
does not support raw SQL query.Is there a way I can work with cursor while using raw SQL query (with joins) with RedBeanPHP?
Thank you!