genSQL - Documentation
genSQL
Homepage
Download Area
Screenshots
Mailinglists
Supported Databases
Documentation
Usage Statistics
User Interface
There is no documentation on the UI yet, since it's not very extensive (yet) and it should be easy to figure out how to interact with the UI.
Developer's documentation
GDBI

genSQL is built upon the mid-level (or middleware, if you like) library GDBI, (Generic Database Interface) which provides a general API for all databases. GDBI is strongly event-orientated, so it's very well suited for use in GUIs. GDBI itself relies on GQL, a CLI (Call Level Interace) to SQL databases.

The GDBI library is used internally by genSQL, but might be usefull for other projects, too. So some day it will probably be "externalized".

Design considerations

When you look at the GDBI classes, you will notice that many functions don't have return a value.

So how do you get the Connection object after calling Session::get_connection(), for example? You hook up a function onto the Session::connection_opened signal. This function then gets called whenever a connection is established and is given the connection index as an argument, so you can access it via the array returned by Session::connections().

Why is this all this complicated? Why not the straight, simple way and have Session::get_connection() just return the newly opened connection? Well, setting things up the way described above has some (maybe not obvious) big benefits.

The function (get_connection() in the example) may return immediatly and defer the work of actually opening a connection to some queue or another thread, which then emits the signal. This is a (quite elegant, I think) way to write non-blocking GUIs.

It also features the Document/View design pattern: All GDBI objects are documents, on which an arbitrary number of views can be generated. Since all views that need to know when a connection is opened (for visualizing it), are connected to the connection_opened signal, document changes are reflected in all views without special coding.

API
The native C++ (i plan to wrap it up in CORBA IDL in the near future) GDBI API is documented here. Unfortunatly, I was quite lazy writting the documentation comments in the headers, so this is merely a browsable, indexed .h file collection...
Concepts, Design

The whole application aims to be totally GUI/functionality seperated. This is done in two ways:

First, there are high-level abstract interfaces for some GUI Elements (like the Frame class, which provides a View with the ability to be inserted in it and change its menus). The 'real' GUI compoments (Gnome/Gtk+, for instance) are then derived from these interfaces. This allows for GUI-independend code to be written wich uses those interfaces.

Second, the GDBI plays a essential role: GUI elements that are a visual representation of GDBI objects (Tables, Datasets, Connections to Databases, etc.) are hooked upon them via signals as described above. This means when a GDBI object is changed somehow (be it via an arbitrary GUI element or out of a scripting language), the changes are reflected in the GUI representing it.

Record Home Bugs Mailing List News Download
This site is hosted by SourceForge. Thanks!

Andreas Rottmann