]> git.joonet.de Git - adminer.git/commitdiff
ClickHouse ALTER DELETE and ALTER UPDATE support
authorsartor <sartorua@gmail.com>
Sat, 20 Oct 2018 16:41:35 +0000 (19:41 +0300)
committerJakub Vrana <jakub@vrana.cz>
Sat, 27 Oct 2018 17:31:35 +0000 (19:31 +0200)
adminer/drivers/clickhouse.inc.php

index 5f39c8bace7e071eed86ce615a0d8dcb7701261c..37631a5c302e53a5527e359b4892d4496a9f4d62 100644 (file)
@@ -122,6 +122,18 @@ if (isset($_GET["clickhouse"])) {
 
 
        class Min_Driver extends Min_SQL {
+        function delete($table, $queryWhere, $limit = 0) {
+            return queries("ALTER TABLE " . table($table) . "DELETE $queryWhere");
+        }
+
+        function update($table, $set, $queryWhere, $limit = 0, $separator = "\n") {
+            $values = array();
+            foreach ($set as $key => $val) {
+                $values[] = "$key = $val";
+            }
+            $query = "$separator" . implode(",$separator", $values);
+            return queries("ALTER TABLE ".table($table)." UPDATE $query$queryWhere");
+        }
        }
 
        function idf_escape($idf) {
@@ -335,6 +347,10 @@ if (isset($_GET["clickhouse"])) {
                return '';
        }
 
+    function last_id() {
+        return 0; // ClickHouse doesn't have it
+    }
+
        function support($feature) {
                return preg_match("~^(columns|sql|status|table)$~", $feature);
        }