1
0
mirror of https://github.com/danog/postgres.git synced 2024-12-02 17:37:57 +01:00
postgres/src/Quoter.php

30 lines
864 B
PHP
Raw Normal View History

2018-07-05 07:11:37 +02:00
<?php
namespace Amp\Postgres;
interface Quoter
{
/**
* 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.
*
* @throws \Error If the connection to the database has been closed.
*/
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.
*
* @throws \Error If the connection to the database has been closed.
*/
public function quoteName(string $name): string;
}