1
0
mirror of https://github.com/danog/postgres.git synced 2024-11-30 04:29:12 +01:00
postgres/lib/Handle.php
Aaron Piotrowski 2f0017c7a4
Add Handle interface and Pool::getConnection()
Adds quoteString() and quoteName() methods. Pool::getConnection() returns a promise that resolves to an instance of PooledConnection.
2017-08-01 00:38:12 -05:00

25 lines
721 B
PHP

<?php
namespace Amp\Postgres;
interface Handle extends Executor {
/**
* 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.
*/
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.
*/
public function quoteName(string $name): string;
}