From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Steven Rémot" <steven.remot@gmail.com>
Cc: emacs-orgmode@gnu.org, "Thomas S. Dye" <tsd@tsdye.com>
Subject: Re: [PATCH] Add support for :dbhost, :dbuser and :database parameters for poastgresql in ob-sql.el
Date: Sat, 20 Sep 2014 14:16:40 +0200 [thread overview]
Message-ID: <8761gia3mf.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <541D6B40.7030501@gmail.com> ("Steven \=\?utf-8\?Q\?R\=C3\=A9mot\=22\?\= \=\?utf-8\?Q\?'s\?\= message of "Sat, 20 Sep 2014 13:55:44 +0200")
Hello,
Steven Rémot <steven.remot@gmail.com> writes:
> This patch adds support for :dbhost, :dbuser and :database parameters
> for SQL code blocks that uses postgresql engine. This allows to
> abstract postgresql login details instead of sending parameters in
> a psql-specific format using :cmdline argument.
Thanks for your patch. Some comments below.
> * lisp/ob-sql.el: Add support for :dbhost, :dbuser and :database
> parameters in sql code blocks for postgresql engine.
It should be
* lisp/ob-sql.el (dbstring-postgresql): New function
(org-babel-execute:sql): Use new function.
> +(defun dbstring-postgresql (host user database)
> + "Make PostgreSQL command line ards for database connection.
^^^^
args
> +Pass nil to omit that arg."
> + (combine-and-quote-strings
> + (remq nil
> + (list (when host (concat "-h" host))
> + (when user (concat "-U" user))
> + (when database (concat "-d" database))))))
> +
This is not related to your patch, but while you're at it, use `delq'
instead of `remq' (nitpick) and `dbstring-postgresql' needs to be
renamed `org-babel-sql-dbstring-postgresql' or some such.
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2014-09-20 12:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-08 20:11 [PATCH] Add support for :dbhost, :dbuser and :database parameters for poastgresql in ob-sql.el Steven Rémot
2014-08-09 0:38 ` Thomas S. Dye
2014-08-09 10:04 ` Steven Rémot
2014-08-09 15:31 ` Thomas S. Dye
2014-08-09 16:02 ` Steven Rémot
2014-09-20 11:55 ` Steven Rémot
2014-09-20 12:16 ` Nicolas Goaziou [this message]
2014-09-20 13:31 ` Steven Rémot
2014-09-20 21:09 ` 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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
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=8761gia3mf.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=emacs-orgmode@gnu.org \
--cc=steven.remot@gmail.com \
--cc=tsd@tsdye.com \
/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/org-mode.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).