[DB-SIG] Which db mapping tool?

Gerhard Häring haering_postgresql@gmx.de
Tue, 16 Jul 2002 11:04:49 +0200


* David Warnock <david@sundayta.com> [2002-07-16 09:49 +0100]:
> Hi,
> 
> I have been using Python a little for a while, finding it very useful 
> for text file processing. Now I would like to start using it for 
> applications where I normally use Java (GUI and Web Apps).
> 
> I am looking for a OR mapping layer so that
> 
> a) I can "normally" avoid writing SQL by hand
> b) I can move easily between different dbms
> 
> I have seen the following so far
> 	MiddleKit (Webware)

I've been trying to add PostgreSQL support to MiddleKit, but didn't
finish it. The main problem is that MiddleKit requires something like
last_insert_id being available, which isn't the case in PostgreSQL. I
tried to make a quick hack with Pg's OIDs, but this didn't work because
MiddleKit packs the id column in the lower range of a dword, and
something else in the higher range (or the other way round). Pretty
stupid design, IMNSHO.

> PyDo (SkunkWeb)

> I currently use Firebird, MySql and Postgresql but am also interested
> in using SQLite. I recognise that I will probably have to add support
> for the Firebird and SQLite drivers to most OR layers as they typially
> already support MySql and Postgresql.

Feel free to ask on the PySQLite mailing lists if you need additional
features to support an OR wrapper. We'll happily add it. There will of
course be some difficulties to get type support in (you'll need to use
pysqlite_client_pragma, as SQLite is typeless).

> My questions
> 
> 1. Are there other OR layers worth looking at

Maybe dbObj http://www.valdyas.org/python/dbobj.html

> 2. Any recommendations between these OR Layers

Of all the ones I checked out for Java and Python, I found none of them
satisfactory. Ok, I haven't really used them in practise, only in demo
projects, but they just didn't work for me. I think they all assume that
you can change the DB schema as you like, which very often isn't the
case for me. And if they just persist Python objects in a relational
database, then I have to ask why not to use an OODBMS like ZODB in the
first place.

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id AD24C930
public key fingerprint: 3FCC 8700 3012 0A9E B0C9  3667 814B 9CAA AD24 C930
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))