[orm-devel] Firebird adapter - new version and a question
Diedrich Vorberg
orm-devel@mailman.tux4web.de
Fri Feb 28 11:22:13 CET 2003
Hi Werner,
>New version is up on CVS.
Thank you very much! It looks great, actually I don't think it could
have been any more efficient than that.
>Should I not change the "gen" column to serial, obviously with special
>handling in the FB adapter. The idea would be that it would be very
>nice if the class definitions of ORM stay DB independent, so that one
>can write stuff and switch from one db to another WITHOUT having to make
>any changes (at least to the ORM related stuff).
>
>What do you think?
No, I think the name is fine.
ORM's basic idea has been to wrap the database backends in a 'opaque'
way, i.e. you're sopposed to see then shining through. The programmer
is supposed to know (and appreciate) his basic SQL. A "plug, play and
plug another" design like with real object relational layer is not
what I had in mind.
In my experiance these products only claim backend independence but
you'll have to test and debug with any backend you're going to use
anyway. Also you'll have to introduce tons of if {} statements to
compansate for bugs you didn't make. As a result most applications
stick with one RDBMS.
With orm you'll have to provide backend independance yourself. If I'd
want my program to work with say psql and FB I'd:
if pgsql:
from orm.adapter.pgsql.datasource import datasource
from orm.adapter.pgsql.columns import *
elif FB:
from orm.adapter.firebird.datasource import datasource
from orm.adapter.firebird.columns import *
serial = gen
It might be a good idea to provide a meta-adapter that takes care of
this kind of think and provides a number of unified SQL type names
and corresponding column types.
Anyway I think that each individual adapter should stay as close to
its RDBMS as it can.
Diedrich
--
_..._ Diedrich Vorberg
.' '.
/ _ _ \ http://www.tux4web.de
| (o)_(o) | info@tux4web.de
\( ) / .---.
//'._.'\ \ / \ Internet Dienstleistungen
// . \ \ \.@-@./ und 'Consulting'.
|| . \ \ /`\_/`\
|\ : / | // _ \\ Linux Rules!
\ `) ' (` /_ | \ )|_
_)``".____,.'"` (_ /`\_`> <_/ \
) )'--'( ( \__/'---'\__/
'---` `---`
More information about the orm-devel
mailing list