[Zope-DB] Dynamic Update SQLs like in Delphi

Liliam Martins liliam at cmartins.demon.nl
Thu Dec 11 17:28:23 EST 2003


Hi,

google for dynamic sql/queries on zope. There are previous threads on this
list about this matter and an howto on zope.org web site.

Regarding point 4, Zope is transactional, so if you have a script that
modifies dynamically a ZSQL, other requests for that script will be
serialised (wait for their turn to access the script).

Regards,
Fernando

> -----Original Message-----
> From: zope-db-bounces at zope.org
> [mailto:zope-db-bounces at zope.org]On Behalf Of fowlertrainer at anonym.hu
> Sent: quarta-feira, 10 de Dezembro de 2003 10:41
> To: zope-db at zope.org
> Subject: [Zope-DB] Dynamic Update SQLs like in Delphi
>
>
> Szia !
>
> Mellékelem a levelemet.
>
> ----------------
>
> 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
>
>
> _______________________________________________
> Zope-DB mailing list
> Zope-DB at zope.org
> http://mail.zope.org/mailman/listinfo/zope-db




More information about the Zope-DB mailing list