1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-26 10:49:38 +00:00

Fix issue with dbi processing in ob-sql.

* lisp/ob-sql.el (org-babel-execute:sql): Unquote cmdline argument in
  format string, dbish requires three separate arguments. Add dbi to
  the list of engines with automatically added header separator.
This commit is contained in:
Rick Frankel 2013-03-19 16:51:42 -04:00
parent eff59a15d7
commit 78b3a03981

View File

@ -103,10 +103,10 @@ This function is called by `org-babel-execute-src-block'."
(org-babel-temp-file "sql-out-")))
(header-delim "")
(command (case (intern engine)
('dbi (format "dbish --batch '%s' < %s | sed '%s' > %s"
('dbi (format "dbish --batch %s < %s | sed '%s' > %s"
(or cmdline "")
(org-babel-process-file-name in-file)
"/^+/d;s/^\|//;$d"
"/^+/d;s/^\|//;s/(NULL)/ /g;$d"
(org-babel-process-file-name out-file)))
('monetdb (format "mclient -f tab %s < %s > %s"
(or cmdline "")
@ -142,6 +142,7 @@ This function is called by `org-babel-execute-src-block'."
(with-temp-buffer
(cond
((or (eq (intern engine) 'mysql)
(eq (intern engine) 'dbi))
(eq (intern engine) 'postgresql))
;; Add header row delimiter after column-names header in first line
(cond