2016-12-30 06:21:17 +01:00
|
|
|
<?php
|
2016-09-14 16:27:39 +02:00
|
|
|
|
|
|
|
namespace Amp\Postgres;
|
|
|
|
|
2017-05-16 06:14:02 +02:00
|
|
|
use Amp\Iterator;
|
|
|
|
use Amp\Promise;
|
|
|
|
|
2017-12-03 02:35:49 +01:00
|
|
|
interface ResultSet extends Iterator {
|
2017-11-16 16:43:18 +01:00
|
|
|
const FETCH_ARRAY = 0;
|
|
|
|
const FETCH_ASSOC = 1;
|
|
|
|
const FETCH_OBJECT = 2;
|
2017-05-16 06:14:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
2017-05-26 05:47:49 +02:00
|
|
|
*
|
2017-11-16 16:43:18 +01:00
|
|
|
* @param int $type Next row fetch type. Use the FETCH_* constants provided by this interface.
|
2017-05-16 06:14:02 +02:00
|
|
|
*/
|
2017-11-16 16:43:18 +01:00
|
|
|
public function advance(int $type = self::FETCH_ASSOC): Promise;
|
2016-09-14 16:27:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the number of fields (columns) in each row.
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
2017-11-16 16:43:18 +01:00
|
|
|
public function numFields(): int;
|
2016-09-14 16:27:39 +02:00
|
|
|
}
|