Thanks for the patch, I would like to apply it. Have you signed the FSF papers for contribution to Org-mode and Emacs? If you haven't would you be willing to? See the Org-mode contribution instructions for more information. http://orgmode.org/worg/org-contribute.html
Thanks! r...@rickster.com (Rick Frankel) writes: > From 113bbbe1ce9540e2af8c613ba655599fc474cedd Mon Sep 17 00:00:00 2001 > From: Rick Frankel <r...@rickster.com> > Date: Fri, 11 May 2012 16:54:32 -0400 > Subject: [PATCH] Add support for perl dbi to SQL code block > > * lisp/ob-sql.el (org-babel-execute:sql): Add dbi as a suppored engine. > > Invokes `dbish' with the arguments specified to ":cmdline". Minimum is > usually the "dbi:{dbd}" argument, plus the username and password if > required. > For example: > > lisp/ob-sql.el | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el > index e3f6edd..c6d4790 100644 > --- a/lisp/ob-sql.el > +++ b/lisp/ob-sql.el > @@ -71,6 +71,11 @@ 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" > + (or cmdline "") > + (org-babel-process-file-name in-file) > + "/^+/d;s/^\|//;$d" > + (org-babel-process-file-name out-file))) > ('monetdb (format "mclient -f tab %s < %s > %s" > (or cmdline "") > (org-babel-process-file-name in-file) > @@ -90,7 +95,11 @@ This function is called by `org-babel-execute-src-block'." > (or cmdline ""))) > (t (error "no support for the %s sql engine" engine))))) > (with-temp-file in-file > - (insert (org-babel-expand-body:sql body params))) > + (insert > + (case (intern engine) > + ('dbi "/format partbox\n") > + (t "")) > + (org-babel-expand-body:sql body params))) > (message command) > (shell-command command) > (if (or (member "scalar" result-params) -- Eric Schulte http://cs.unm.edu/~eschulte/