diff options
author | Steven RĂ©mot <steven.remot@gmail.com> | 2014-09-20 15:09:29 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2014-09-20 23:06:40 +0200 |
commit | e228cd1060dbc736493a114bb05b95d79a37bcff (patch) | |
tree | bd2cb0db8a5452224cef267091272858f6008c6d | |
parent | e5e9fc974d3e1bb0e50b843f65d4f6689043574e (diff) | |
download | org-mode-e228cd1060dbc736493a114bb05b95d79a37bcff.tar.gz |
ob-sql.el: Clean mysql parameters generation
* lisp/ob-sql.el (dbstring-mysql): Rename function and tweak a bit its
implementation
(org-babel-execute:sql): Use new function name
Prefix `dbstring-mysql' function with the namespace "org-babel-sql" to
avoid name collisions.
Also replace the call to `remq' by `delq' because it is a bit more
efficient, and also to be consistent with
`org-babel-sql-dbstring-postgresql'.
-rw-r--r-- | lisp/ob-sql.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el index 292d5dd..493b3dc 100644 --- a/lisp/ob-sql.el +++ b/lisp/ob-sql.el @@ -78,10 +78,10 @@ (org-babel-sql-expand-vars body (mapcar #'cdr (org-babel-get-header params :var)))) -(defun dbstring-mysql (host user password database) +(defun org-babel-sql-dbstring-mysql (host user password database) "Make MySQL cmd line args for database connection. Pass nil to omit that arg." (combine-and-quote-strings - (remq nil + (delq nil (list (when host (concat "-h" host)) (when user (concat "-u" user)) (when password (concat "-p" password)) @@ -126,7 +126,7 @@ This function is called by `org-babel-execute-src-block'." (org-babel-process-file-name in-file) (org-babel-process-file-name out-file))) ('mysql (format "mysql %s %s %s < %s > %s" - (dbstring-mysql dbhost dbuser dbpassword database) + (org-babel-sql-dbstring-mysql dbhost dbuser dbpassword database) (if colnames-p "" "-N") (or cmdline "") (org-babel-process-file-name in-file) |