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); } }