unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Carlos Pita <carlosjosepita@gmail.com>
To: 32724@debbugs.gnu.org
Subject: bug#32724: 26.1; sql.el: support presto client
Date: Wed, 12 Sep 2018 14:08:35 -0300	[thread overview]
Message-ID: <87efdyfxt8.fsf@gmail.com> (raw)

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





             reply	other threads:[~2018-09-12 17:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-12 17:08 Carlos Pita [this message]
2019-06-23 21:50 ` bug#32724: 26.1; sql.el: support presto client Lars Ingebrigtsen
2019-06-26  3:15   ` Michael Mauger
2019-06-26 11:02     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87efdyfxt8.fsf@gmail.com \
    --to=carlosjosepita@gmail.com \
    --cc=32724@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).