2017-08-01 07:38:12 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Amp\Postgres;
|
|
|
|
|
|
|
|
interface Handle extends Executor {
|
2017-11-05 22:38:17 +01:00
|
|
|
/**
|
|
|
|
* Indicates if the connection to the database is still alive.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function isAlive(): bool;
|
|
|
|
|
2017-08-01 07:38:12 +02:00
|
|
|
/**
|
|
|
|
* Quotes (escapes) the given string for use as a string literal or identifier in a query. This method wraps the
|
|
|
|
* string in single quotes, so additional quotes should not be added in the query.
|
|
|
|
*
|
|
|
|
* @param string $data Unquoted data.
|
|
|
|
*
|
|
|
|
* @return string Quoted string wrapped in single quotes.
|
2017-11-06 05:36:22 +01:00
|
|
|
*
|
|
|
|
* @throws \Amp\Postgres\ConnectionException If the connection to the database has been lost.
|
2017-08-01 07:38:12 +02:00
|
|
|
*/
|
|
|
|
public function quoteString(string $data): string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Quotes (escapes) the given string for use as a name or identifier in a query.
|
|
|
|
*
|
|
|
|
* @param string $name Unquoted identifier.
|
|
|
|
*
|
|
|
|
* @return string Quoted identifier.
|
2017-11-06 05:36:22 +01:00
|
|
|
*
|
|
|
|
* @throws \Amp\Postgres\ConnectionException If the connection to the database has been lost.
|
2017-08-01 07:38:12 +02:00
|
|
|
*/
|
|
|
|
public function quoteName(string $name): string;
|
|
|
|
}
|