From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nik Clayton Subject: RFC: ob-sql-mode.el: Use sql-mode with Org Babel Date: Fri, 16 Dec 2016 12:09:24 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1141e4feb1d37f0543c49c37 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHqOy-0007al-3V for emacs-orgmode@gnu.org; Fri, 16 Dec 2016 06:10:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHqOt-0002vW-Qk for emacs-orgmode@gnu.org; Fri, 16 Dec 2016 06:10:12 -0500 Received: from mail-yw0-x230.google.com ([2607:f8b0:4002:c05::230]:34978) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cHqOt-0002sL-LN for emacs-orgmode@gnu.org; Fri, 16 Dec 2016 06:10:07 -0500 Received: by mail-yw0-x230.google.com with SMTP id i145so29578150ywg.2 for ; Fri, 16 Dec 2016 03:10:06 -0800 (PST) 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" To: emacs-orgmode@gnu.org --001a1141e4feb1d37f0543c49c37 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hoi, I'd like to solicit feedback on ob-sql-mode.el, https://github.com/nikclayton/org-mode/commit/106b22e9ef4835e15efc47d63aaee= e675a1ebb69 . 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. =E2=80=8BI'm about to go on vacation for a few weeks, so won't have the cha= nce 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.=E2=80=8B Best, =E2=80=8BN --=20 Google Switzerland GmbH, Identifikationsnummer: CH-020.4.028.116-1 --001a1141e4feb1d37f0543c49c37 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hoi,

<= div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif= ">
This introduces a new Org Babel language, "sql-mode&quo= t;. Unlike the current "sql" language, this one uses sql-mode to = manage the interaction with the SQL interpreters, so it supports all the ba= ckends that sql-mode supports.

It also supports sessio= ns, so you can have different src blocks connected to different databases o= r configurations in that database.

If you have, for e= xample, "sqlite" installed on your system, you can put the follow= ing (rather trivial) query in an Org file and evaluate it in the usual way<= /div>

#+BEGIN_SRC sql-mode :product sqlite
SELECT 1, 2, 3;
#+END_= SRC

The evaluation result will look like
<= div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif= ">
: 1|2|3


Org propert= y headers and drawers are also supported, so you could omit the :product ar= gument if you had

#+PROPERTY: header-args:sql-mode :product sqlite<= br>

or a property drawer that looked like
=

:PROPERTIES:
:header-args: :product s= qlite
:END:

in sc= ope.

=E2=80=8BI'm about to go on vaca= tion for a few weeks, so won't have the chance to respond to feedback u= ntil early January, but I wanted to get this out there. I'm releasing t= his in my capacity as a Google employee, and Google has a copyright assignm= ent on file with the FSF.=E2=80=8B

Best, =E2=80=8BN<= /div>
--
Google Switzerland GmbH, I= dentifikationsnummer: CH-020.4.028.116-1
--001a1141e4feb1d37f0543c49c37--