From d52632cafa896022904f5ee659a8b7c3b7ba98f5 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Wed, 12 Aug 2020 07:57:23 +0200 Subject: [PATCH] Use JsonEachRow format in ShowCreateTable \n"s were escaped with TabSeparated --- src/Snippet/ShowCreateTable.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Snippet/ShowCreateTable.php b/src/Snippet/ShowCreateTable.php index 6014dfe..32758a8 100644 --- a/src/Snippet/ShowCreateTable.php +++ b/src/Snippet/ShowCreateTable.php @@ -5,7 +5,8 @@ namespace SimPod\ClickHouseClient\Snippet; use SimPod\ClickHouseClient\Client\ClickHouseClient; -use SimPod\ClickHouseClient\Format\TabSeparated; +use SimPod\ClickHouseClient\Format\JsonEachRow; +use Webmozart\Assert\Assert; use function trim; final class ShowCreateTable @@ -16,9 +17,12 @@ public static function run(ClickHouseClient $clickHouseClient, string $tableName <<contents); + $statement = $output->data[0]['statement']; + Assert::string($statement); + + return trim($statement); } }