Tcl Relational Algebra Library

What is TclRal?

TclRAL is a "C" based extention of the TCL language that is an implementation of the Relational Algebra. From a programmers point of view, the library is a Tcl package that introduces two new native data types and a set of commands that operate on them. The new data types are:

The library also contains three primary commands each of which is an ensemble of sub commands that are the operations available on the Tuple and Relation type. Other commands are provided to pretty print relation values and load/store sets of relation variables.

What is Relational Algebra?

Relational algebra is the application of formal mathematical concepts to managing data. It is most often discussed in terms of the Relational Model of Data and in that context it is often associated with Database Management Systems (DBMS). However, relations are logical entities and do not depend upon any particular DBMS for an implementation. TclRal is patterned after the relational algebra described by Date (Date, C.J., An Introduction to Database Systems, 8th ed, Pearson Education, 2004, ISBN 0-321-19784-4, chap. 7).

Where do I get TclRal ?

TclRal is being hosted at SourceForge and so has a project page. The initial public release was version 0.6. The current release is version 0.10.1.

Is there any documentation?

A short introductory tutorial is available. The paper presented at the 13th Annual Tcl Conference is a more detailed description and examples of the functionality of the package. Documentation for the commands in the package is also available.

Questions about TclRAL

Why would I want to use this?
TclRAL makes possible a set at a time style of programming that can be very powerful. Relations can handle complicated data structures and relationships among the data in a consistent formal manner. The operators on relations eliminate most of the need for looping constructs that are usually present in a more single instance approach to handling program data. You can think of the relation data type as a rather fancy table-like thing that is a native Tcl data type.
So is TclRAL a data base?
No. Currently, the library provides only load and store type of persistence. That is not sufficient for database applications. Transparent persistence is a very desirable feature and may be included in the future.
What's in store for the future?
The current release (0.10.1) is compatible at the script level to Version 0.9.1 Support for the 0.8 series is ending and one purpose of the 0.9 and 0.10 series is to stablize the interface in preparation for a 1.0 release where backward compatiblity will be a goal. Since 0.8 several new commands have been added as experience has shown them necessary or desirable. The 1.0 series is planned to support cascading update and delete operations on relvars.

Raloo - A Relation Oriented Programming Extension

Raloo is a new relation oriented programming extension to Tcl. It combines TclRAL with TclOO to create a programming framework that allows you to structure data relationally and yet still program in an object oriented style. The current release is Version 0.2, so it is quite new and a bit experimental. You can also download raloo from the sourceforge project page. Documentation is only a manual page that can be found at: Note that Raloo has not been updated to work with TclRAL 0.9 yet. That will happen in a new release.

I recently presented a paper on Raloo at the 15th Annual Tcl/Tk Convention. Both the paper and the presentation are available.




    SourceForge.net Logo