1
0
mirror of https://github.com/danog/postgres.git synced 2024-12-15 19:07:26 +01:00
postgres/lib/Executor.php

44 lines
1.0 KiB
PHP
Raw Normal View History

2016-12-30 06:21:17 +01:00
<?php
2016-09-14 16:27:39 +02:00
namespace Amp\Postgres;
use Amp\Promise;
2016-09-14 16:27:39 +02:00
interface Executor {
/**
* @param string $sql
*
* @return \Amp\Promise<\Amp\Postgres\CommandResult|\Amp\Postgres\TupleResult>
2016-09-14 16:27:39 +02:00
*
* @throws \Amp\Postgres\FailureException
*/
2016-11-15 18:06:21 +01:00
public function query(string $sql): Promise;
2016-09-14 16:27:39 +02:00
/**
* @param string $sql
* @param mixed ...$params
*
* @return \Amp\Promise<\Amp\Postgres\CommandResult|\Amp\Postgres\TupleResult>
2016-09-14 16:27:39 +02:00
*
* @throws \Amp\Postgres\FailureException
*/
2016-11-15 18:06:21 +01:00
public function execute(string $sql, ...$params): Promise;
2016-09-14 16:27:39 +02:00
/**
* @param string $sql
*
* @return \Amp\Promise<\Amp\Postgres\Statement>
2016-09-14 16:27:39 +02:00
*
* @throws \Amp\Postgres\FailureException
*/
2016-11-15 18:06:21 +01:00
public function prepare(string $sql): Promise;
2017-05-16 06:28:37 +02:00
/**
* @param string $channel Channel name.
* @param string $payload Notification payload.
*
* @return \Amp\Promise<\Amp\Postgres\CommandResult>
*/
2016-11-15 18:06:21 +01:00
public function notify(string $channel, string $payload = ""): Promise;
2016-09-14 16:27:39 +02:00
}