[orm-devel] ORM adapter for Firebird by Werner F. Bruhin
Werner F. Bruhin
Thu, 20 Feb 2003 22:07:24 +0100
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
Thanks for the quick reply.<br>
Note that the code I sent you is NOT functional yet, need to get the
call to the stored procedure working (at a minimum!) and work over the
Will try work on it over the next few days and you can count on it that
I will be in touch.<br>
Diedrich Vorberg wrote:<br>
<pre wrap="">Hi Werner,
pleased to meet you!
<pre wrap="">I would like to evaluate ORM (version 0.8) and SQLObjects (managed to
get it working with Firebird) for a project, but want to use it with
Firebird. So, I started putting a ORM-Firebird adapter together -
looking at MySql and PostGre adapters you did and copied/pasted and
changed a little.
<pre wrap=""><!---->That's great news! Actually there's not much more to do than that to
create a new adapter.
<pre wrap="">Firebird is different to PostGre and MySql in how it handles
autoinc/sequence columns. It has a generator and one can either use a
trigger to generate the ID and would then have to do a query to get it
(not sure that this can be done in a way which is 100% reliable),
another method is to call a stored procedure which returns the ID to be
used and insert that into the object before the actual insert is done -
I prefer the later method.
<pre wrap="">My current problem is that I am not sure how to get to the connection
and create a cursor and call the stored procedure.
Each datasource class has a _dbconn() method which returns a valid
DBAPI connection object. The default implementation (inherited from
datasource_base) just returns the _conn attribute of its object.
<pre wrap="">Another question, in my test script (see full script below) I have to insert
"from orm.adapters.firebird.columns import * "
to get the firebird columns, should that be automatically loaded by
orm.datasources depending on what adapter type one is requesting??
Users are supposed to use lines like these:
from orm.columns import *
from orm.adapters.myadapter.columns import *
This way each adaper's custom datatype/column classes are available.
Also, an adapter's column module could replace datatypes from orm's
column module this way if that should be necessary.
<pre wrap="">Would appreciate any hints/help on this.
<pre wrap=""><!---->Werner, your work is very much appreciated here and I'll be happy to
answer any question you might have!
I'll put the files you sent into the CVS repository now, so they
should be available shortly. I'll put comments in when I think it
might be helpful.
Also, if you are interested, I can create an account on
c200.tux4web.de for you, so you can check in your changes and keep a
$Log: 000144.html,v $
Revision 1.1 2006/05/12 10:06:28 diedrich
*** empty log message ***
using CVS. Do you have ssh and cvs installed?