unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32724: 26.1; sql.el: support presto client
@ 2018-09-12 17:08 Carlos Pita
  2019-06-23 21:50 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Carlos Pita @ 2018-09-12 17:08 UTC (permalink / raw)
  To: 32724

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 ";"))





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-26 11:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-12 17:08 bug#32724: 26.1; sql.el: support presto client Carlos Pita
2019-06-23 21:50 ` Lars Ingebrigtsen
2019-06-26  3:15   ` Michael Mauger
2019-06-26 11:02     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).