mirror of
https://github.com/danog/sql.git
synced 2024-11-26 20:15:08 +01:00
Use Stream API for ResultSet
This commit is contained in:
parent
a4d011c7dd
commit
82e0a68540
@ -12,7 +12,7 @@
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=7",
|
||||
"amphp/amp": "^2"
|
||||
"amphp/amp": "dev-streams as 2.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "dev-master",
|
||||
|
@ -2,14 +2,23 @@
|
||||
|
||||
namespace Amp\Sql;
|
||||
|
||||
use Amp\Iterator;
|
||||
use Amp\Promise;
|
||||
use Amp\Stream;
|
||||
|
||||
interface ResultSet extends Iterator
|
||||
interface ResultSet extends Stream
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* Promise returned resolves with a map (associative array) of column-names to column-values for each row in the
|
||||
* result set. The promise resolves with null when no more rows remain.
|
||||
*
|
||||
* @return array Map of row names to values.
|
||||
* @return Promise<array<string, mixed>|null>
|
||||
*/
|
||||
public function getCurrent(): array;
|
||||
public function continue(): Promise;
|
||||
|
||||
/**
|
||||
* Resolves with a new instance of ResultSet if another result is available after this result.
|
||||
*
|
||||
* @return Promise<ResultSet|null>
|
||||
*/
|
||||
public function getNextResultSet(): Promise;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user