Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Update to reflect API changes #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions sql-clickhouse.el
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -155,13 +167,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)))

Expand All @@ -172,15 +184,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