From ed1fe3a7cdbb3341f2a146eb552d095dde674dce Mon Sep 17 00:00:00 2001 From: Dmitry Moskowski Date: Tue, 9 May 2023 21:50:36 +0000 Subject: [PATCH 1/3] use more human-friendly option names --- sql-clickhouse.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql-clickhouse.el b/sql-clickhouse.el index dc4ad34..c251b68 100644 --- a/sql-clickhouse.el +++ b/sql-clickhouse.el @@ -155,13 +155,13 @@ Argument OPTIONS additional options." (let ((params (append (unless (string= "" sql-user) - (list "-u" sql-user)) + (list "--user" sql-user)) (unless (string= "" sql-password) - (list "--password" sql-password)) + (list "--password" sql-password)) (unless (string= "" sql-database) - (list "-d" sql-database)) + (list "--database" sql-database)) (unless (string= "" sql-server) - (list "-h" sql-server)) + (list "--host" sql-server)) options))) (sql-comint product params buffname))) From 1e1addcfaca53c5b28b4ca26ba261b89c702ea57 Mon Sep 17 00:00:00 2001 From: Dmitry Moskowski Date: Tue, 9 May 2023 21:52:06 +0000 Subject: [PATCH 2/3] fix errors preventing it from working --- sql-clickhouse.el | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sql-clickhouse.el b/sql-clickhouse.el index c251b68..e355be6 100644 --- a/sql-clickhouse.el +++ b/sql-clickhouse.el @@ -172,15 +172,14 @@ Optional argument BUFFER current buffer." (interactive "P") (sql-product-interactive 'clickhouse buffer)) -(sql-add-product 'clickhouse "ClickHouse" '(:font-lock sql-clickhouse-font-lock-keywords - :sqli-program sql-clickhouse-program - :prompt-regexp "^:) " - :prompt-length 3 - :prompt-cont-regexp "^:-] " - :sqli-login sql-clickhouse-login-params - :sqli-options sql-clickhouse-options - :sqli-comint-func sql-clickhouse-comint)) - +(sql-add-product 'clickhouse "ClickHouse" + :font-lock 'sql-clickhouse-font-lock-keywords + :sqli-program 'sql-clickhouse-program + :sqli-login 'sql-clickhouse-login-params + :sqli-options 'sql-clickhouse-options + :sqli-comint-func 'sql-clickhouse-comint + :sqli-prompt-regexp "^[^\s]* :\) " + :sqli-prompt-cont-regexp "^[^\s]*:-\] ") (provide 'sql-clickhouse) ;;; sql-clickhouse.el ends here From 55a731af66ef7d5c38c2ae380ad095f07f3ffbff Mon Sep 17 00:00:00 2001 From: Dmitry Moskowski Date: Tue, 9 May 2023 22:02:23 +0000 Subject: [PATCH 3/3] update clickhouse types list --- sql-clickhouse.el | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/sql-clickhouse.el b/sql-clickhouse.el index e355be6..581195d 100644 --- a/sql-clickhouse.el +++ b/sql-clickhouse.el @@ -50,9 +50,21 @@ (sql-font-lock-keywords-builder 'font-lock-type-face nil ;; column types - "Array" "Date" "DateTime" "Enum8" "Enum16" "FixedString" "Float32" - "Float64" "Int8" "Int16" "Int32" "Int64" "UInt8" "UInt16" "UInt32" - "UInt64" "String" "Tuple" + "Float32" + "Float64" + "Int8" "Int16" "Int32" "Int64" "Int128" "Int256" + "UInt8" "UInt16" "UInt32" "UInt64" "UInt128" "UInt256" + "Decimal" "Decimal32" "Decimal64" "Decimal128" "Decimal256" + "Date" "DateTime" "DateTime64" + "Enum8" "Enum16" + "Array" + "Tuple" + "FixedString" + "String" + "Nullable" + "Map" + "JSON" + "Nested" ;; engine types "AggregatingMergeTree" "Buffer" "CollapsingMergeTree" "Distributed"