Subject: Re: bug#32724: 26.1; sql.el: support presto client

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 23 Jun 2019 23:50:38 +0200

Carlos Pita <[email-masked]> writes:

> Here is a tentative partial implementation:
>
> (defun sql-presto (&optional buffer)
>   (interactive "P")
>   (sql-product-interactive 'presto buffer))
>
> (defun sql-comint-presto (product options &optional buf-name)
>   (let* ((catalog-schema (split-string sql-database ":"))
>          (params (append options
>                          (list "--user" sql-user
>                                "--server" sql-server
>                                "--catalog" (car catalog-schema)
>                                "--schema" (cadr catalog-schema)))))
>     (sql-comint product params buf-name)))
>
> (defvar sql-presto-login-params '(user server database))
>
> (setf (alist-get 'presto sql-product-alist)
>       '(:name "Presto"
>         :font-lock sql-mode-ansi-font-lock-keywords
>         :sqli-program "bash"
>         :sqli-options ("-c" "PRESTO_PAGER= TERM=vt100 presto $@" "--")
>         :sqli-login sql-presto-login-params
>         :sqli-comint-func sql-comint-presto
>         :list-all "SHOW TABLES;"
>         :list-table "SHOW COLUMNS FROM %s;"
>         :prompt-regexp "^[[:alnum:]]+:[[:alnum:]]+> "
>         :prompt-cont-regexp "^[[:blank:]]+-> "
>         :terminator ";"))

I've Cc'd Michael Mauger on this -- perhaps he has a comment.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no