From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: (no subject) Date: Fri, 11 May 2012 16:38:07 -0400 Message-ID: <874nrmxxlc.fsf@gmx.com> References: <20120511205649.14CB015ACCA6@BigDog.local> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSyTd-00062d-6t for emacs-orgmode@gnu.org; Fri, 11 May 2012 18:38:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSyTb-0003TX-3J for emacs-orgmode@gnu.org; Fri, 11 May 2012 18:38:20 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:39025 helo=mailout-us.mail.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SSyTa-0003SP-TM for emacs-orgmode@gnu.org; Fri, 11 May 2012 18:38:19 -0400 In-Reply-To: <20120511205649.14CB015ACCA6@BigDog.local> (Rick Frankel's message of "Fri, 11 May 2012 16:56:48 -0400 (EDT)") 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: Rick Frankel Cc: emacs-orgmode@gnu.org 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! rick@rickster.com (Rick Frankel) writes: > From 113bbbe1ce9540e2af8c613ba655599fc474cedd Mon Sep 17 00:00:00 2001 > From: Rick Frankel > 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/