emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] RFC: ob-sql-mode.el: Use sql-mode with Org Babel


From: Nik Clayton
Subject: [O] RFC: ob-sql-mode.el: Use sql-mode with Org Babel
Date: Fri, 16 Dec 2016 12:09:24 +0100

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]