From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gary Oberbrunner Subject: patch for ob-sql.el: improve MySQL header formatting, and add db spec header vars Date: Fri, 1 Feb 2013 10:18:25 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=bcaec54ee31042edb904d4ab41c4 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1INo-0007Ew-Sj for emacs-orgmode@gnu.org; Fri, 01 Feb 2013 10:18:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U1INn-0006mk-KE for emacs-orgmode@gnu.org; Fri, 01 Feb 2013 10:18:28 -0500 Received: from mail-oa0-f42.google.com ([209.85.219.42]:42160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1INn-0006mC-E3 for emacs-orgmode@gnu.org; Fri, 01 Feb 2013 10:18:27 -0500 Received: by mail-oa0-f42.google.com with SMTP id i18so4083409oag.29 for ; Fri, 01 Feb 2013 07:18:26 -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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Orgmode Mailing List --bcaec54ee31042edb904d4ab41c4 Content-Type: multipart/alternative; boundary=bcaec54ee31042edb604d4ab41c2 --bcaec54ee31042edb604d4ab41c2 Content-Type: text/plain; charset=ISO-8859-1 Let me know if this would be better as a pull request. This patch does three things: * add a header-row delimiter to the tables returned from mysql * adds new sql-specific header args for the database connection, and implements them for mysql * (minor) adds an edebug spec to org-babel-result-cond to allow edebugging through it -- Gary --bcaec54ee31042edb604d4ab41c2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Let me know if this would be better as a pull request. =A0= This patch does three things:

=A0* add a header-row deli= miter to the tables returned from mysql
=A0* adds new sql-spe= cific header args for the database connection, and implements them for mysq= l
=A0* (minor) adds an edebug spec to org-babel-result-cond to allow ede= bugging through it

--
Gary
--bcaec54ee31042edb604d4ab41c2-- --bcaec54ee31042edb904d4ab41c4 Content-Type: application/octet-stream; name="org-mode-sql.patch" Content-Disposition: attachment; filename="org-mode-sql.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hcnh8etm0 ZGlmZiAtLWdpdCBhL2xpc3Avb2ItY29yZS5lbCBiL2xpc3Avb2ItY29yZS5lbAppbmRleCBiZGY4 YzU0Li4xYTQyOTY1IDEwMDY0NAotLS0gYS9saXNwL29iLWNvcmUuZWwKKysrIGIvbGlzcC9vYi1j b3JlLmVsCkBAIC0yNTg1LDcgKzI1ODUsOCBAQCBFbWFjcyBzaHV0ZG93bi4iKSkKIAogKGRlZm1h Y3JvIG9yZy1iYWJlbC1yZXN1bHQtY29uZCAocmVzdWx0LXBhcmFtcyBzY2FsYXItZm9ybSAmcmVz dCB0YWJsZS1mb3JtcykKICAgIkNhbGwgdGhlIGNvZGUgdG8gcGFyc2UgcmF3IHN0cmluZyByZXN1 bHRzIGFjY29yZGluZyB0byBSRVNVTFQtUEFSQU1TLiIKLSAgKGRlY2xhcmUgKGluZGVudCAxKSkK KyAgKGRlY2xhcmUgKGluZGVudCAxKQorCSAgIChkZWJ1ZyAoZm9ybSBmb3JtICZyZXN0IGZvcm0p KSkKICAgYCh1bmxlc3MgKG1lbWJlciAibm9uZSIgLHJlc3VsdC1wYXJhbXMpCiAgICAgIChpZiAo b3IgKG1lbWJlciAic2NhbGFyIiAscmVzdWx0LXBhcmFtcykKIAkgICAgIChtZW1iZXIgInZlcmJh dGltIiAscmVzdWx0LXBhcmFtcykKZGlmZiAtLWdpdCBhL2xpc3Avb2Itc3FsLmVsIGIvbGlzcC9v Yi1zcWwuZWwKaW5kZXggOGQyYmEyNC4uM2VhNzExMiAxMDA2NDQKLS0tIGEvbGlzcC9vYi1zcWwu ZWwKK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S1zcmMtYmxvY2sn LiIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgY21kbGluZSAiIikK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3JnLWJhYmVsLXByb2Nlc3Mt ZmlsZS1uYW1lIGluLWZpbGUpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KG9yZy1iYWJlbC1wcm9jZXNzLWZpbGUtbmFtZSBvdXQtZmlsZSkpKQotICAgICAgICAgICAgICAg ICAgICAoJ215c3FsIChmb3JtYXQgIm15c3FsICVzIDwgJXMgPiAlcyIKKyAgICAgICAgICAgICAg ICAgICAgKCdteXNxbCAoZm9ybWF0ICJteXNxbCAlcyAlcyA8ICVzID4gJXMiCisJCQkJICAgIChk YnN0cmluZy1teXNxbCBkYmhvc3QgZGJ1c2VyIGRicGFzc3dvcmQgZGJkYXRhYmFzZSkKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChvciBjbWRsaW5lICIiKQogCQkJCSAgICAo b3JnLWJhYmVsLXByb2Nlc3MtZmlsZS1uYW1lIGluLWZpbGUpCiAJCQkJICAgIChvcmctYmFiZWwt cHJvY2Vzcy1maWxlLW5hbWUgb3V0LWZpbGUpKSkKQEAgLTEwNywxOSArMTI2LDMyIEBAIFRoaXMg ZnVuY3Rpb24gaXMgY2FsbGVkIGJ5IGBvcmctYmFiZWwtZXhlY3V0ZS1zcmMtYmxvY2snLiIKICAg ICAgICh3aXRoLXRlbXAtYnVmZmVyCiAJICAocHJvZ24gKGluc2VydC1maWxlLWNvbnRlbnRzLWxp dGVyYWxseSBvdXQtZmlsZSkgKGJ1ZmZlci1zdHJpbmcpKSkKICAgICAgICh3aXRoLXRlbXAtYnVm ZmVyCi0JOzsgbmVlZCB0byBmaWd1cmUgb3V0IHdoYXQgdGhlIGRlbGltaXRlciBpcyBmb3IgdGhl IGhlYWRlciByb3cKLQkod2l0aC10ZW1wLWJ1ZmZlcgotC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wb2ludC1taW4pKQorCSAgICAgKHdoZW4gKHJlLXNlYXJjaC1mb3J3YXJkICJeXFwo LStcXClbXi1dIiBuaWwgdCkKKwkgICAgICAgKHNldHEgaGVhZGVyLWRlbGltIChtYXRjaC1zdHJp bmctbm8tcHJvcGVydGllcyAxKSkpCisJICAgICAoZ290by1jaGFyIChwb2ludC1tYXgpKQorCSAg ICAgKGZvcndhcmQtY2hhciAtMSkKKwkgICAgICh3aGlsZSAobG9va2luZy1hdCAiXG4iKQorCSAg ICAgICAoZGVsZXRlLWNoYXIgMSkKKwkgICAgICAgKGdvdG8tY2hhciAocG9pbnQtbWF4KSkKKwkg ICAgICAgKGZvcndhcmQtY2hhciAtMSkpCisJICAgICAod3JpdGUtZmlsZSBvdXQtZmlsZSkpKQor CSAgKQogCShvcmctdGFibGUtaW1wb3J0IG91dC1maWxlICcoMTYpKQogCShvcmctYmFiZWwtcmVh c3NlbWJsZS10YWJsZQogCSAobWFwY2FyIChsYW1iZGEgKHgpCg== --bcaec54ee31042edb904d4ab41c4--