[Haskell] Announce: Takusen - an Oracle DBMS library

Bayley, Alistair Alistair_Bayley at ldn.invesco.com
Wed Mar 17 09:49:33 EST 2004


In keeping with recent announcements regarding database libraries,
Oleg Kiselyov and I present a library to interface to the Oracle DBMS.
This library is a low-level interface for issuing SQL commands,
similar to HSQL. It uses the Oracle Call Interface, a low-level C library
provided with most Oracle installations.

The library is currently hosted by the Haskell-libs project at SourceForge:
  http://sf.net/projects/haskell-libs

Here's a link to the CVS folders:
  http://cvs.sf.net/viewcvs.py/haskell-libs/libs/takusen/


The library is designed around a left-fold enumerator,
previously illustrated here:
  http://pobox.com/~oleg/ftp/Haskell/misc.html#fold-stream
The enumerator is the preferred interface. We also support cursors,
for those rare occasions where you may want to interleave results
from more than one query.

What distinguishes this library from HSQL/ODBC?
 - the groovy left-fold iterator
 - it works with Oracle :-)
 - it only works with Oracle :-(
 - it doesn't use any other libraries or pre-processors e.g. ODBC, hsc2hs

Other features to note:
 - The library is designed to support any DBMS, although we've
   only provided one initial implementation, for Oracle.
   The Oracle-specific code is quite separate from the general code.
   There is also a stub so you can try it without Oracle.
 - The query function is "naturally polyvariadic".
   It can accept any number of arguments of the supported types.
   Type information is used to allocate data buffers and determine
   the correct conversion functions. Buffer allocation is transparent to the
user.
   See examples in Database.Test.SimpleEnumeratorTest:
 
http://cvs.sf.net/viewcvs.py/haskell-libs/libs/takusen/src/Database/Test/Sim
pleEnumeratorTest.lhs?view=markup

Deficiencies (we plan to rectify these soon, more-or-less in this order):
 - iteratee function should be monadic so you can do IO in it.
 - memory leaks exist (in the low-level OCI FFI code).
 - no performance tests (how well does it handle large result sets?).
 - no Haddock docs.
 - can't use OS-authenticated logon i.e. must provide username/password.
 - no bind variables.
 - support for multiple connections is limited.
 - limited set of Haskell/DBMS datatypes (String, Int, Double, CalendarTime)
 - doesn't support LOBs, user-defined DBMS types, and other exotic types.
 - CalendarTime support is incomplete, as Oracle doesn't store the
   Timezone with dates (this has been rectified in Oracle 9 with a
   new datatype: TIMESTAMP). We assume UTC.
 - doesn't support calling procedures, functions, or packages.
 - support for other DBMS's.

* Why didn't we implement HSQL for Oracle?
We started work on this long before we had any idea that HSQL
was being overhauled. And it took a long time.

* Do we have any plans to implement HSQL for Oracle?
Maybe... not right now. I don't think there are any major technical
impediments to writing it; I just lack time and motivation.


Stability:
Experimental. Still under active development.

Portability:
The library was developed on a Windows NT platform against Oracle 8.
As far as I know, there are no Oracle 8 specific features,
so it ought to work against an Oracle 7 DBMS without modification.
It was compiled with GHC 6.01, and uses MPTC, fundeps, overlapping
instances,
and deriving Typeable.


Alistair and Oleg.

-----------------------------------------
*****************************************************************
Confidentiality Note: The information contained in this 
message, and any attachments, may contain confidential 
and/or privileged material. It is intended solely for the 
person(s) or entity to which it is addressed. Any review, 
retransmission, dissemination, or taking of any action in 
reliance upon this information by persons or entities other 
than the intended recipient(s) is prohibited. If you received
this in error, please contact the sender and delete the 
material from any computer.
*****************************************************************



More information about the Haskell mailing list