From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou 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 Message-ID: <8761gia3mf.fsf@nicolasgoaziou.fr> References: <53E52F05.3040106@gmail.com> <53E5F215.10103@gmail.com> <541D6B40.7030501@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVJaX-00047B-Nv for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 08:16:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XVJa7-0006uS-7B for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 08:16:29 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:38055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVJa7-0006tj-1D for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 08:16:03 -0400 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") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Steven =?utf-8?Q?R=C3=A9mot?= Cc: emacs-orgmode@gnu.org, "Thomas S. Dye" Hello, Steven R=C3=A9mot 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, --=20 Nicolas Goaziou