From f15097a2c1a9efaa1463e2e2d0f5944414548dd9 Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Thu, 7 Dec 2023 10:33:53 -0600 Subject: [PATCH] Remove PostgresQuoter Merged into PostgresExecutor. --- src/PostgresExecutor.php | 30 +++++++++++++++++++++++++++++- src/PostgresQuoter.php | 34 ---------------------------------- 2 files changed, 29 insertions(+), 35 deletions(-) delete mode 100644 src/PostgresQuoter.php diff --git a/src/PostgresExecutor.php b/src/PostgresExecutor.php index fcbc262..258c5cc 100644 --- a/src/PostgresExecutor.php +++ b/src/PostgresExecutor.php @@ -9,7 +9,7 @@ /** * @extends Executor */ -interface PostgresExecutor extends PostgresQuoter, Executor +interface PostgresExecutor extends Executor { /** * @return PostgresResult Result object specific to this library. @@ -34,4 +34,32 @@ public function execute(string $sql, array $params = []): PostgresResult; * @throws ConnectionException If the connection to the database is lost. */ public function notify(string $channel, string $payload = ""): PostgresResult; + + /** + * 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; + + /** + * Escapes a binary string to be used as BYTEA data. + */ + public function escapeByteA(string $data): string; } diff --git a/src/PostgresQuoter.php b/src/PostgresQuoter.php deleted file mode 100644 index 3e4d149..0000000 --- a/src/PostgresQuoter.php +++ /dev/null @@ -1,34 +0,0 @@ -