[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] (no subject)
From: |
Eric Schulte |
Subject: |
Re: [O] (no subject) |
Date: |
Fri, 11 May 2012 16:38:07 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
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!
address@hidden (Rick Frankel) writes:
> From 113bbbe1ce9540e2af8c613ba655599fc474cedd Mon Sep 17 00:00:00 2001
> From: Rick Frankel <address@hidden>
> 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/
- [O] (no subject), Rick Frankel, 2012/05/11
- Re: [O] (no subject),
Eric Schulte <=