emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Saulius Menkevičius" <saulius.menkevicius@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] lisp/ob-sql.el: add support for :dbport parameter
Date: Tue, 07 Apr 2015 08:17:59 +0200	[thread overview]
Message-ID: <87zj6kpilk.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <m28ue5ov11.fsf@mbp.Dlink> ("Saulius \=\?utf-8\?Q\?Menkevi\=C4\=8Di\?\= \=\?utf-8\?Q\?us\=22's\?\= message of "Mon, 06 Apr 2015 23:34:50 +0300")


Saulius Menkevičius <saulius.menkevicius@gmail.com> writes:

> This (tiny) patch implements ability to set dbport for org-babel sql
> functionality. I often use ssh port forwarding to connect to remote
> mysql servers where port is mapped to non-standard one on local
> machine.

Thank you.

> This is my first patch, below the 15 line threshold.
> From ca3f85877bdf406deefaf66cbac3483a7e41f134 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Saulius=20Menkevi=C4=8Dius?= <saulius.menkevicius@gmail.com>
> Date: Mon, 6 Apr 2015 23:13:06 +0300
> Subject: [PATCH] ob-sql: Add possibility to set dbport
>  * lisp/ob-sql.el: will now recognize dbport parameter. Currently it
>    is supported for mysql engine only.

You need to also specify what functions are modified, e.g.,

* lisp/ob-sql.el (org-babel-sql-dbstring-mysql): Change signature.

> +(defun org-babel-sql-dbstring-mysql (host port user password database)
>    "Make MySQL cmd line args for database connection.  Pass nil to omit that arg."
>    (combine-and-quote-strings
>     (delq nil
>  	 (list (when host     (concat "-h" host))
> +	       (when port     (concat "-P" (number-to-string port)))

Isn't PORT a string already?

>           (dbhost (cdr (assoc :dbhost params)))
> +         (dbport (cdr (assoc :dbport params)))

Nitpick: `assoc' -> `assq'


Nicolas Goaziou

  parent reply	other threads:[~2015-04-07  6:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06 20:34 [PATCH] lisp/ob-sql.el: add support for :dbport parameter Saulius Menkevičius
2015-04-07  4:49 ` Xavier Maillard
2015-04-07 17:12   ` Saulius Menkevičius
2015-04-07  6:17 ` Nicolas Goaziou [this message]
2015-04-07 17:36   ` Saulius Menkevičius
2015-04-07 20:27     ` Nicolas Goaziou

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:

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87zj6kpilk.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=saulius.menkevicius@gmail.com \


* 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


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