emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nik Clayton <nik@google.com>
To: emacs-orgmode@gnu.org
Subject: RFC: ob-sql-mode.el: Use sql-mode with Org Babel
Date: Fri, 16 Dec 2016 12:09:24 +0100	[thread overview]
Message-ID: <CAFZUrCzXiveZuH=nO2bDd2V20wxaZF8+YSh26=GKFuFJDd9WkA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1440 bytes --]

Hoi,

I'd like to solicit feedback on ob-sql-mode.el,
https://github.com/nikclayton/org-mode/commit/106b22e9ef4835e15efc47d63aaeee675a1ebb69
.

This introduces a new Org Babel language, "sql-mode". Unlike the current
"sql" language, this one uses sql-mode to manage the interaction with the
SQL interpreters, so it supports all the backends that sql-mode supports.

It also supports sessions, so you can have different src blocks connected
to different databases or configurations in that database.

If you have, for example, "sqlite" installed on your system, you can put
the following (rather trivial) query in an Org file and evaluate it in the
usual way

#+BEGIN_SRC sql-mode :product sqlite
SELECT 1, 2, 3;
#+END_SRC

The evaluation result will look like

#+RESULTS:
: 1|2|3


Org property headers and drawers are also supported, so you could omit the
:product argument if you had

#+PROPERTY: header-args:sql-mode :product sqlite

or a property drawer that looked like

:PROPERTIES:
:header-args: :product sqlite
:END:

in scope.

​I'm about to go on vacation for a few weeks, so won't have the chance to
respond to feedback until early January, but I wanted to get this out
there. I'm releasing this in my capacity as a Google employee, and Google
has a copyright assignment on file with the FSF.​

Best, ​N
-- 
Google Switzerland GmbH, Identifikationsnummer: CH-020.4.028.116-1

[-- Attachment #2: Type: text/html, Size: 4245 bytes --]

             reply	other threads:[~2016-12-16 11:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-16 11:09 Nik Clayton [this message]
     [not found] <CAFZUrCzndSLvTAPUXcOALOnpSjaAVK9pe9C8ShNyvZCWKdZ+Dg@mail.gmail.com>
     [not found] ` <CAFZUrCyco6ROHdoTRn=SAdzujNWq9WSt3c4X5EB_cBBZ27iosw@mail.gmail.com>
2016-12-17  9:33   ` RFC: ob-sql-mode.el: Use sql-mode with Org Babel Nik Clayton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFZUrCzXiveZuH=nO2bDd2V20wxaZF8+YSh26=GKFuFJDd9WkA@mail.gmail.com' \
    --to=nik@google.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).