0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-13 00:40:04 +00:00
org-mode/lisp
Viktor Rosenfeld bd3b1aee2f add support for MonetDB to SQL code blocks
* lisp/ob-sql.el(org-babel-execute:sql): Add support for MonetDB to
  SQL code blocks.

  Hi,

  the attached patch adds support for evaluating SQL blocks on MonetDB.
  The MonetDB client normally requires the password to be inputted on the
  console. To get around this, you have to use a dotfile ~/.monetdb with
  authentification data. Note that this file is ignored if you specify a
  user on the cmdline. See
  http://www.monetdb.org/Documentation/mclient-man-page for details.

  A usage example follows.

  Setup MonetDB test database and authentification data

  #+BEGIN_SRC sh :results output verbatim
  MONETDB_DIR=$HOME/unix/var/monetdb/demodb
  monetdbd create $MONETDB_DIR
  monetdbd start $MONETDB_DIR
  monetdb create demodb
  monetdb release demodb
  cat > ~/.monetdb <<EOF
  user=monetdb
  password=monetdb
  EOF
  #+END_SRC

  #+RESULTS:
  : created database in maintenance mode: demodb
  : taken database out of maintenance mode: demodb

  Data is returned without column names (the default return format
  cannot be parsed by Babel).

  #+BEGIN_SRC sql :engine monetdb :cmdline demodb
  CREATE TABLE foo ( bar INTEGER );
  SELECT 'Table count', count(*) FROM foo;
  #+END_SRC

  #+RESULTS:
  | Table count | 0 |

  The parameter "-i" is required on the command line in order to use
  special client commands. Also note that a newline is required at the
  end if the last line contains a special client command.

  #+BEGIN_SRC sql :engine monetdb :cmdline demodb -i :results output
  verbatim
  \d
  \?

  #+END_SRC

  #+RESULTS:
  #+begin_example
  TABLE  sys.foo
  \?      - show this message
  \<file  - read input from file
  \>file  - save response in file, or stdout if no file is given
  \|cmd   - pipe result to process, or stop when no command is given
  \h      - show the readline history
  \D table- dumps the table, or the complete database if none given.
  \d[Stvsfn]+ [obj] - list database objects, or describe if obj given
  \A      - enable auto commit
  \a      - disable auto commit
  \e      - echo the query in sql formatting mode
  \f      - format using a built-in renderer {csv,tab,raw,sql,xml}
  \w#     - set maximal page width (-1=unlimited, 0=terminal width,
  >0=limit to num)
  \r#     - set maximum rows per page (-1=raw)
  \L file - save client/server interaction
  \X      - trace mclient code
  \q      - terminate session
  #+end_example

  Have fun!
2012-02-25 09:44:18 -07:00
..
ob-asymptote.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
ob-awk.el More fixes to the copyright year... 2012-02-19 08:18:53 -07:00
ob-C.el More copyright year fixes. 2012-02-19 08:16:42 -07:00
ob-calc.el Copyright, license, and header fixes. 2012-02-19 08:21:03 -07:00
ob-clojure.el Merge branch 'origin-maint' 2012-01-13 13:09:34 -07:00
ob-comint.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
ob-css.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
ob-ditaa.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
ob-dot.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
ob-emacs-lisp.el Copyright, license, and header fixes. 2012-02-19 08:21:03 -07:00
ob-eval.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
ob-exp.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
ob-fortran.el Fix typos and spelling mistakes. 2012-02-19 08:23:42 -07:00
ob-gnuplot.el Fix trailing whitespaces. 2012-01-04 16:20:04 +01:00
ob-haskell.el Fix trailing whitespaces. 2012-01-04 16:20:04 +01:00
ob-java.el More fixes to the copyright year... 2012-02-19 08:18:53 -07:00
ob-js.el Copyright, license, and header fixes. 2012-02-19 08:21:03 -07:00
ob-keys.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
ob-latex.el Fix typos and spelling mistakes. 2012-02-19 08:23:42 -07:00
ob-ledger.el Fix typos and spelling mistakes. 2012-02-19 08:23:42 -07:00
ob-lilypond.el More copyright year fixes. 2012-02-19 08:16:42 -07:00
ob-lisp.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
ob-lob.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
ob-matlab.el More copyright year fixes. 2012-02-19 08:16:42 -07:00
ob-maxima.el fix compiler warning in ob-maxima.el 2012-01-05 10:44:11 -07:00
ob-mscgen.el More copyright year fixes. 2012-02-19 08:16:42 -07:00
ob-ocaml.el Fix trailing whitespaces. 2012-01-04 16:20:04 +01:00
ob-octave.el More copyright year fixes. 2012-02-19 08:16:42 -07:00
ob-org.el More copyright year fixes. 2012-02-19 08:16:27 -07:00
ob-perl.el Copyright, license, and header fixes. 2012-02-19 08:21:03 -07:00
ob-picolisp.el Copyright, license, and header fixes. 2012-02-19 08:21:03 -07:00
ob-plantuml.el More copyright year fixes. 2012-02-19 08:16:42 -07:00
ob-python.el Copyright, license, and header fixes. 2012-02-19 08:21:03 -07:00
ob-R.el Merge branch 'origin-maint' 2012-01-30 18:36:31 -07:00
ob-ref.el Fix trailing whitespaces. 2012-01-04 16:20:04 +01:00
ob-ruby.el Copyright, license, and header fixes. 2012-02-19 08:21:03 -07:00
ob-sass.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
ob-scheme.el Copyright, license, and header fixes. 2012-02-19 08:21:03 -07:00
ob-screen.el Copyright, license, and header fixes. 2012-02-19 08:21:03 -07:00
ob-sh.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
ob-shen.el Copyright, license, and header fixes. 2012-02-19 08:21:03 -07:00
ob-sql.el add support for MonetDB to SQL code blocks 2012-02-25 09:44:18 -07:00
ob-sqlite.el Copyright, license, and header fixes. 2012-02-19 08:21:03 -07:00
ob-table.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
ob-tangle.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
ob.el enhancements to org-babel-goto-named-src-block 2012-02-25 09:36:15 -07:00
org-agenda.el Merge branch 'maint' 2012-02-25 11:13:58 +01:00
org-archive.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-ascii.el Fix trailing whitespaces. 2012-01-04 16:20:04 +01:00
org-attach.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-bbdb.el Fix some compiler warnings in org-bbdb.el. 2012-01-05 17:55:35 +01:00
org-beamer.el Fix typos and spelling mistakes. 2012-02-19 08:23:42 -07:00
org-bibtex.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-capture.el Fix typos and spelling mistakes. 2012-02-19 08:23:42 -07:00
org-clock.el Fix typos and spelling mistakes. 2012-02-19 08:23:42 -07:00
org-colview-xemacs.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org-colview.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org-compat.el Fix typos and spelling mistakes. 2012-02-19 08:23:42 -07:00
org-crypt.el More copyright year fixes. 2012-02-19 08:16:42 -07:00
org-ctags.el Fix typos and spelling mistakes. 2012-02-19 08:23:42 -07:00
org-datetree.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org-docbook.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-docview.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org-entities.el More copyright year fixes. 2012-02-19 08:16:27 -07:00
org-eshell.el Copyright, license, and header fixes. 2012-02-19 08:21:03 -07:00
org-exp-blocks.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-exp.el Merge branch 'maint' 2012-02-22 09:31:10 +01:00
org-faces.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-feed.el org-feed.el: Add all default drawers in the commentary section. 2012-01-29 00:45:31 +01:00
org-footnote.el org-footnote: Allow footnotes in verse blocks 2012-02-24 09:44:36 +01:00
org-freemind.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-gnus.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-habit.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-html.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-icalendar.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-id.el Fix trailing whitespaces. 2012-01-04 16:20:04 +01:00
org-indent.el Make the display of the first star in an inline task optional 2012-01-30 07:55:51 +01:00
org-info.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org-inlinetask.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-irc.el Fix trailing whitespaces. 2012-01-04 16:20:04 +01:00
org-jsinfo.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org-latex.el org-list: Remove two defcustoms 2012-02-19 09:16:21 -07:00
org-list.el org-list: Whitespace cleanup 2012-02-21 11:59:12 +01:00
org-lparse.el Pull up ODT files from "maint" to "master" levels 2012-02-20 10:25:31 +05:30
org-mac-message.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org-macs.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org-mew.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org-mhe.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org-mks.el More copyright year fixes. 2012-02-19 08:16:42 -07:00
org-mobile.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-mouse.el Copyright, license, and header fixes. 2012-02-19 08:21:03 -07:00
org-odt.el Pull up ODT files from "maint" to "master" levels 2012-02-20 10:25:31 +05:30
org-pcomplete.el Let pcomplete handle drawers. 2012-01-25 10:01:39 +01:00
org-plot.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org-protocol.el Fix typos and spelling mistakes. 2012-02-19 08:23:42 -07:00
org-publish.el Fix typos and spelling mistakes. 2012-02-19 08:23:42 -07:00
org-remember.el Fix trailing whitespaces. 2012-01-04 16:20:04 +01:00
org-rmail.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org-special-blocks.el Fix trailing whitespaces. 2012-01-04 16:20:04 +01:00
org-src.el Merge branch 'origin-maint' 2012-02-18 10:39:04 -07:00
org-table.el Fix typos and spelling mistakes. 2012-02-19 08:23:42 -07:00
org-taskjuggler.el Fix typos and spelling mistakes. 2012-02-19 08:23:42 -07:00
org-timer.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-vm.el Support for links to IMAP folders in org-vm.el 2012-01-20 17:06:04 +01:00
org-w3m.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org-wl.el Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1) 2012-02-13 15:49:28 +01:00
org-xoxo.el Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
org.el Correctly unfold headlines containing an inlinetask 2012-02-19 09:15:19 -07:00