Use Stream API for ResultSet

This commit is contained in:
Aaron Piotrowski 2020-05-21 10:48:42 -05:00
parent a4d011c7dd
commit 82e0a68540
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB
2 changed files with 15 additions and 6 deletions

View File

@ -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",

View File

@ -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;
}