]> git.joonet.de Git - adminer.git/commitdiff
support for array values in clickhouse driver
authorVladimir Goncharov <morozovsk@gmail.com>
Wed, 17 Nov 2021 12:48:29 +0000 (14:48 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 19 Feb 2025 13:36:07 +0000 (14:36 +0100)
plugins/drivers/clickhouse.php

index 48a2e68d3771657810960ef3cbae432d4a9196b3..5b2d615c006d698e0edc0003806f11ed13064d4f 100644 (file)
@@ -90,8 +90,14 @@ if (isset($_GET["clickhouse"])) {
                var $num_rows, $_rows, $columns, $meta, $_offset = 0;
 
                function __construct($result) {
+                       foreach ($result['data'] as $item) {
+                               $row = array();
+                               foreach ($item as $key => $val) {
+                                       $row[$key] = is_scalar($val) ? $val : json_encode($val, 256); // 256 - JSON_UNESCAPED_UNICODE
+                               }
+                               $this->_rows[] = $row;
+                       }
                        $this->num_rows = $result['rows'];
-                       $this->_rows = $result['data'];
                        $this->meta = $result['meta'];
                        $this->columns = array_column($this->meta, 'name');
                        reset($this->_rows);