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

* bug#32724: 26.1; sql.el: support presto client
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-23 21:50 UTC (permalink / raw)
  To: Carlos Pita; +Cc: Michael R. Mauger, 32724

Carlos Pita <carlosjosepita@gmail.com> 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





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

* bug#32724: 26.1; sql.el: support presto client
  2019-06-23 21:50 ` Lars Ingebrigtsen
@ 2019-06-26  3:15   ` Michael Mauger
  2019-06-26 11:02     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Mauger @ 2019-06-26  3:15 UTC (permalink / raw)
  To: larsi, carlosjosepita; +Cc: michael, 32724

[-- Attachment #1: Type: text/plain, Size: 967 bytes --]

-------- Original Message --------
> On Jun 23, 2019, 5:50 PM, Lars Ingebrigtsen < larsi@gnus.org> wrote:
> Carlos Pita <carlosjosepita@gmail.com> writes:
> > Here is a tentative partial implementation:
> >
> > ...
> I've Cc'd Michael Mauger on this -- perhaps he has a comment.

I'm sorry, I thought I had already responded to this on debbugs already...

My recommendation is to implement this as an ELPA package. That way it can be on a more frequent release cycle than core Emacs, and it gives you and others more leeway to provide more workflow features tailored specifically to Presto.

You've gone to this much effort.
You are going to have to assign your copyright to the FSF if the code is included in sql.el or in an ELPA module.
Come join us and become a package maintainer. I can certainly provide some guidance, but you've got a solid starting point.

Come join the Free side! :)

-- MICHAEL@MAUGER.COM // FSF and EFF member // GNU Emacs sql.el maintainer

[-- Attachment #2: Type: text/html, Size: 1078 bytes --]

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

* bug#32724: 26.1; sql.el: support presto client
  2019-06-26  3:15   ` Michael Mauger
@ 2019-06-26 11:02     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-26 11:02 UTC (permalink / raw)
  To: Michael Mauger; +Cc: michael, carlosjosepita, 32724

Michael Mauger <mmauger@protonmail.com> writes:

> My recommendation is to implement this as an ELPA package. That way it
> can be on a more frequent release cycle than core Emacs, and it gives
> you and others more leeway to provide more workflow features tailored
> specifically to Presto.

OK; then this doesn't seem applicable to the Emacs bug tracker, and I'm
closing this bug report.

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





^ 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).