[orm-devel] ORM adapter for Firebird by Werner F. Bruhin

Werner F. Bruhin orm-devel@mailman.tux4web.de
Sat, 22 Feb 2003 22:40:18 +0100


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body>
Diedrich,<br>
<br>
I finally got FB 1.5 beta 2 to work today, this is one of the reasons I
haven't got back to you before.<br>
<br>
1.5 provides a nicer way of implementing the Generator stuff (can exec
a statement within a stored procedure - although can not get it to work
yet).<br>
<br>
Your last mail was all I needed to get the db connection going.<br>
<br>
Hope to have some update early next week - which should handle at least
the basics.<br>
<br>
I do have CVS (Tortoise) which has SSH built in, so if it makes things
easier for everyone set up an account, otherwise I just keep sending
you the two files.<br>
<br>
Best regards<br>
Werner<br>
<br>
Diedrich Vorberg wrote:<br>
<blockquote type="cite"
 cite="mid15957.4506.327955.394434@lisa.tux4web.de">
  <pre wrap="">Hi Werner,

pleased to meet you!

  </pre>
  <blockquote type="cite">
    <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>
  </blockquote>
  <pre wrap=""><!---->That's great news! Actually there's not much more to do than that to 
create a new adapter.

  </pre>
  <blockquote type="cite">
    <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>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
  <blockquote type="cite">
    <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.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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>
  <blockquote type="cite">
    <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??
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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>
  <blockquote type="cite">
    <pre wrap="">Would appreciate any hints/help on this.
    </pre>
  </blockquote>
  <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: 000145.html,v $
Revision 1.1  2006/05/12 10:06:28  diedrich
*** empty log message ***
 using CVS. Do you have ssh and cvs installed?

Diedrich

  </pre>
</blockquote>
</body>
</html>