mirror of
https://github.com/danog/postgres.git
synced 2024-12-15 19:07:26 +01:00
36 lines
809 B
PHP
36 lines
809 B
PHP
|
<?php declare(strict_types = 1);
|
||
|
|
||
|
namespace Amp\Postgres;
|
||
|
|
||
|
use Interop\Async\Awaitable;
|
||
|
|
||
|
interface Executor {
|
||
|
/**
|
||
|
* @param string $sql
|
||
|
*
|
||
|
* @return \Interop\Async\Awaitable<\Amp\Postgres\Result>
|
||
|
*
|
||
|
* @throws \Amp\Postgres\FailureException
|
||
|
*/
|
||
|
public function query(string $sql): Awaitable;
|
||
|
|
||
|
/**
|
||
|
* @param string $sql
|
||
|
* @param mixed ...$params
|
||
|
*
|
||
|
* @return \Interop\Async\Awaitable<\Amp\Postgres\Result>
|
||
|
*
|
||
|
* @throws \Amp\Postgres\FailureException
|
||
|
*/
|
||
|
public function execute(string $sql, ...$params): Awaitable;
|
||
|
|
||
|
/**
|
||
|
* @param string $sql
|
||
|
*
|
||
|
* @return \Interop\Async\Awaitable<\Amp\Postgres\Statement>
|
||
|
*
|
||
|
* @throws \Amp\Postgres\FailureException
|
||
|
*/
|
||
|
public function prepare(string $sql): Awaitable;
|
||
|
}
|