the elj project

Open Source Eiffel Libraries and Applications

(SmartEiffel and ISE Eiffel)


ELJ database connectivity

ELJ database connectivity

Introduction

The ELJ database connectivity cluster (dbs) provides access to some popular open source database management systems.
There are two levels of abstraction available: first the more or less direct API wrapper and second, high level class hierarchy.

Contact Info

People who can help are:

Prerequisites

The ELJ installation provides some client (or even engine) interfaces only for the Win32 version of the lib. Most of the required packages are already part of modern Linux distributions or much easier to obtain and install for Linux than for Windows. So, if you get a linkage error the most likely cause is that you don't have the required C lib available.

Notes the on supported DBMS types

Although we have tried to provide a similar interface to all supported DBMSs, there are some differences whcih are worth to mention here.

Berkeley DB

The precompiled library for the Berkeley DB is part of the Win32 distribution of ELJ, but not of the Linux version, because it is already installed on most Linux systems.
There are two libs on top of the direct API interface available, the ELJ record manager and the ELJ_SC_TABLE, whereby only the latter one is compatible to the standard ELJ database connectivity. The major diiference to the other implementations is that this one has no implementation for a database connection class.

Firebird

The highest developed interface we have so far. Includes a table and a transaction class.

PostgreSQL

Basic implementation which includes a query and a database connection class.

SQLite

Basic implementation which includes a query and a database connection class. Please note that even if the parser of SQLite accepts most Ansi SQL conforme statements, it does only implement a subset of what it accepts. Also, the attributes of an SQLite relation are always stored and retrieved as STRING (as for version 2.7.2) so the only field type the SQLite interface implementation provides is STRING.

The core classes

The heart of the database connectivity lib consists of the following classes. Some of the are deferred and are implemented by descendents in a DBMS specific way.

Database connections

Database connection objects are implementations of the deferred class ELJ_DATABASE. They provide the basic connection line to a certain database. Most parameters of these connections are controlled by an option string which lokks like:

      "option1 = 'value1' option2 = 'value2'"
    
Which option / value pairs are used by a certain implementation can be found in the headers of the class texts. A database connection object ignores all options it does not know about, so you can (mis-)use these options also for application defined values.

Data providers

The ELJ_DATA_PROVIDER is the deferred base for DBMS specific query and table classes. After activating a data provider, it can open multiple cursors to provide access to its content.

Table style classes

Table descendents of ELJ_DATA_PROVIDER are designed to provide access to a single relation. The relation is selected by choosing a name. It is most likely the easiest way to access data.

Query style classes

Query descendents of ELJ_DATA_PROVIDER allow to execute SQL statements within the limits of the underlying DBMS, they are implemented as pass through callers which do not modify the given statements in any way. The can excute commands and create result sets.

Cursors

As mentioned above, cursor are created by implementations of ELJ_DATA_PROVIDER to access data in the form of 'rows' or 'tuples'. A data provider creates its 'main' cursor while getting activated and only this cursor is allowed to perform data manipulation operations if these ops are supported by the implementation. Every other cursor is considered read only.

Records

Every cursor has an associated record, which provides access to the attribute values of the row the cursor points to. The field objects a record manages are created automatically when a cursor gets activated.

Data field classes

In nearly every case the attributes of a certain relation are typed and so we have several descendents of the base calss ELJ_DATA_FIELD. The appropriate type of class to create for a certain attribute is chosen automatically.

The core classes

  

More Info

elj Project Quick Links
Project Status/Warning (25 July 2003)
Official Downloads:
0.7 Release (20 Jun 03) (announce getting started docs)
Docs: Tutorial (pdf), Style (pdf) Syntax etl3
wxEiffel: wxWindows (ver:2.4.1) (cvs, wxWindows, lists: users dev, news *, wx-c)
Common Classes (cvs)
elj-db: elj database interface
elj FireBird interface (cvs, lists)
elj sqlite (cvs, home, list, news, SQL)
elj SleepyCat interface (cvs, news)
elj mysql interface) (cvs)
elj Postgres interface (cvs, news)
elj btrieve (cvs news)
compression: zlib bzip2/bzlib
elj Lua interface (cvs home list news)
elj libxml2 interface (cvs eg list news)
os: elj win32api interface
Related/Interesting
Eiffel Struggle 2003 (NICE cetus-links ceug)
ewg (Eiffel<->C) (home cvs news)
ePDF (PDF) (home cvs news)
yaesockets (home cvs news)
nenie Eiffel (xml,networking,snmp,DES,..) - (homepage cvs)
Goanna (web services) - (cvs)
mico/E (open source Eiffel CORBA services )
ePosix: posix interface (news)
EiffelOpenGL (sf cvs)
elj-girls: our first application
diuturnal: multiplayer turn-based strategy game (home cvs)
elj Perlish -(cvs examples Perl)
elj Reg Exp -(cvs PCRE)

elj Dependency Links
SmartEiffel (GNU Eiffel Compiler FAQ) - (beta bugs list news *)
ISE Eiffel (downloads) - (list cle faqs)
GOBO Project (lists: dev user commits cvs geant * gexace)
elj Mailing List: (elj-devel elj-users elj-commits)

elj hosted and supported by SourceForge

``.. in open source, software lives on if there are enough believers to keep it alive ..'' (WSJ - 20 Jul 2003)

http://elj.sourceforge.net/docs/dbs
Dec 04, 2003, 00:26 UTC