[Zope] Dynamic Update SQLs like in Delphi

fowlertrainer at anonym.hu fowlertrainer at anonym.hu
Wed Dec 10 03:09:38 EST 2003


Hello !

In Delphi I have a my own created mechanism what help me to do less
code/error, and more performance in database/dataset handling.

The technology is that:

    1./ When I open a table with TDataSet.Open method, then it was
        generate updatesql array, and updatesql components.
    2./ It is cache the modifications.
    3./ In apply it is process the cache, and rewrite modifications in RW
        transaction.

    It is same with TClientDataSet class, but enhanced.

When I was write an site in php, I rewrite this mechanism in php, and
it is working good.

Ok, but in this time I want to port it to Zope.

In the 1./ the code is like this:
   a.) Get table name from SQL
   b.) Get the pyhisical fields of the table -> filter (omit) the
       another table fields, exmp: joined/grouped/etc.
   c.) Get a key fields from parameter, or the first field.
   d.) Generate SQL for INS/DEL/UPD
   e.) Store it

In Zope I don't see any possibility to I create on-fly statements.

My mechanism is good, because in my database I have 200 tables, and if
I want to create all zsql method to all table, then I must write 200*3
update sql statement, and 200*1 select by id sql statement.
And I don't say about the special selects - my way is handle all of
these statements.

So there are the ways I see to do it:
1./  I write it by hand. Many time,.... :-(((((((((((((
2./  I write an xml section creator in py. I create din. sqls in
     python+xml, and I insert into exported zope site file.
     Then I import it to zope.
3./  I write an subsite, what load all table descriptors to arrays,
     and create the zsql methods into zope site's folder.
     When the database content (structure) is changed, I recreate all
     zsql method.
4./  I access the zsql-s on-fly, and when it is must change (the table
     structure is changed) then I change the zsql method.
     But I don't know, what is happening, when another zope request
     thread is working with this method...
5./  I access the DA object, and can create dynamic SQL-s. But I can
     do that ????
6./  I change the zope to the mod_python. (I don't want to do it, only
     if I haven't any solution)
7./  I am going to Antarctis, or to the Moon. Or to insane...

1/2/3 solutions are very ugly things, because the many zsql method
is many text, and the zope fs is grow to very large.

And when I forget to recreate this methods, the site is unavailable.

Please help me: what I can do ?

Thanx for any advance.

-- 
Best regards,
 fowlertrainer                          mailto:fowlertrainer at anonym.hu




More information about the Zope mailing list