Updated 2012-09-20 09:19:24 by LkpPo

Tiny SQL for metakit databases.

This is an preliminary release! Author: Dr. Detlef Groth, MPIMG Berlin

Current homepage is at: http://goblet.molgen.mpg.de/tsql4mk/

From the readme:



tsql4mk is an experimental library and a console application for executing SQL statements against Metakit databases. It implements a subset of SQL92. tsql4mk uses Jean-Claude Wippler's Oomk and William Duquette's "snit" (Snit Is Not Incrtcl), version 0.97. The API is modelled after R. Hipps great SQLite http://www.sqlite.org. These manuals were partially copied and adjusted for tsql4mk from the language reference of SQLite [1]. Thanks to D. Richard Hipp for this great piece of software.


The main limits of tsql4mk against SQLite are:

  • much lower speed, although not measured yet (layer on a layer ...)
  • only a small subset of the SQL language is implemented
  • limited join capabilites
  • no NULL is known

The advantages are:

  • no compilation required if you use the tclkit [2] runtime
  • console, library and documentation are in one file -> easy installation and deployment
  • yan can start with tsql4mk and later on switch to SQLite

 |   ----------------
 |   Usage: tsql4mk.kit ?-doc? ?-example? ?-run? ?-help? <filename>

 |     -doc            Show a bit of documentation
 |     -example        Display the example script
 |     -run            Run the example script
 |     -html           Show the html documentation


To use tsql4mk, either unwrap tsql4mk.kit (using sdx) and source "tsql4mk.tcl", or if you use a new Tclkit with Metakit 2.4.9: simply source this starkit.


tsql4mk.kit can be also as stand-alone console application in several ways:
 |   Usage: tsql4mk.kit <filename> <SQL STATEMENT>

or via pipes:
 |   echo <SQL STATEMENT> | tsql4mk.kit <filename>

Pipes can be used to execute several SQL statements at once from a file and pipe this into the tsql4mk.kit application.
 |   cat <sqlfile> | tsql4mk.kit <filename>

This feature can be also used to convert a sqlite database into a metakit database:
 |   echo .dump | sqlite test.sqlite | tsql4mk.kit <filename>

The reverse way metakit -> sqlite is currently not yet implemented.


See http://goblet.molgen.mpg.de/tsql4mk/index.html


If you don't have already download tclkit suitable for your platform from www.equi4.com [3]. Put it in your path. Download tsql4mk.kit from here [4]. Done!


  • 2005-04-18 Initial release. 0.1
  • 2005-05-03 Fix for inserting strings with commas inside a table 0.1.1
  • 2005-11-25 Release 0.1.6