Hello,
Steven Rémot <[email protected]> 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