Cursor
class Cursor (View source)
Declare a cursor.
Constants
BINARY |
Causes the cursor to return data in binary rather than in text format. You probably do not want to use that. |
INSENSITIVE |
The data returned by the cursor should be unaffected by updates to the tables underlying the cursor that take place after the cursor was opened. |
WITH_HOLD |
The cursor should stay usable after the transaction that created it was successfully committed. |
SCROLL |
Force that rows can be retrieved in any order from the cursor. |
NO_SCROLL |
Force that rows are only retrievable in sequiential order. NOTE: See the notes in the official PostgreSQL documentation for more information. |
Properties
Connection read-only | $connection | The connection the cursor was declared on. |
|
string read-only | $name | The identifying name of the cursor. |
Methods
Declare a cursor.
Close an open cursor.
[Asynchronously](pq/Connection/: Asynchronous Usage) close an open cursor.
[Asynchronously](pq/Connection/: Asynchronous Usage) fetch rows from the cursor.
[Asynchronously](pq/Connection/: Asynchronous Usage) move the cursor.
Reopen a cursor.
[Asynchronously](pq/Connection/: Asynchronous Usage) reopen a cursor.
Details
__construct(Connection $connection, string $name, int $flags, string $query, bool $async)
Declare a cursor.
See pq\Connection::declare().
close()
Close an open cursor.
This is a no-op on already closed cursors.
closeAsync()
[Asynchronously](pq/Connection/: Asynchronous Usage) close an open cursor.
See pq\Cursor::close().
Result
fetch(string $spec = "1")
Fetch rows from the cursor.
See pq\Cursor::move().
fetchAsync(string $spec = "1", callable $callback = null)
[Asynchronously](pq/Connection/: Asynchronous Usage) fetch rows from the cursor.
See pq\Cursor::fetch().
Result
move(string $spec = "1")
Move the cursor.
See pq\Cursor::fetch().
moveAsync(string $spec = "1", callable $callback = null)
[Asynchronously](pq/Connection/: Asynchronous Usage) move the cursor.
See pq\Cursor::move().
open()
Reopen a cursor.
This is a no-op on already open cursors.
NOTE: Only cursors closed by pq\Cursor::close() will be reopened.
openAsync()
[Asynchronously](pq/Connection/: Asynchronous Usage) reopen a cursor.
See pq\Cursor::open().