Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: DB

Unified DA for Zope 2 using SQLAlchemy?

 

 

Zope db RSS feed   Index | Next | Previous | View Threaded


lists at zopyx

Mar 25, 2007, 8:49 AM

Post #1 of 12 (2961 views)
Permalink
Unified DA for Zope 2 using SQLAlchemy?

Hi,

Sunday afternoon, time for some weird thoughts :-)

In the Zope 2 worlds we have dedicated database adapters
for different databases. Fortunately the Python world made us a
wonderful present called SQLAlchemy that abstracts the different
databases. In the Zope world we have some wrappers like
z3c.zalchemy and z3c.sqlalchemy... basically they deal with connection
handling, mapper handling and integration with the Zope transaction
system. Would it make sense to replace all different Zope DAs with
a generic DA on top of one of the z3c.* wrappers? I think it would not
be too hard to write such a DA...or am I missing something? Thoughts?

Andreas


maciej.wisniowski at coig

Mar 25, 2007, 2:54 PM

Post #2 of 12 (2857 views)
Permalink
Re: Unified DA for Zope 2 using SQLAlchemy? [In reply to]

> In the Zope 2 worlds we have dedicated database adapters
> for different databases. Fortunately the Python world made us a
> wonderful present called SQLAlchemy that abstracts the different
> databases. In the Zope world we have some wrappers like
> z3c.zalchemy and z3c.sqlalchemy... basically they deal with connection
> handling, mapper handling and integration with the Zope transaction
> system. Would it make sense to replace all different Zope DAs with
> a generic DA on top of one of the z3c.* wrappers? I think it would not
> be too hard to write such a DA...or am I missing something? Thoughts?

Now (in Zope2) we have things like ZOracleDA (DCOracle2), ZPsycopgDA
etc. that are adapters to these specific databases. They're based on
Shared/DC/ZRDB/.
In Zope3 there are also such adapters eg. one using cx_Oracle. They're
based on Zope3 rdb module.

What do you mean by 'replacing' them? You want wrapper build for
z3c.* to be used instead of ZRDB (rdb)?

You're talking about Zope2 or Zope3 too?

I don't fully understand what you want to do...

--
Maciej Wisniowski
_______________________________________________
Zope-DB mailing list
Zope-DB [at] zope
http://mail.zope.org/mailman/listinfo/zope-db


lists at zopyx

Mar 25, 2007, 10:07 PM

Post #3 of 12 (2856 views)
Permalink
Re: Unified DA for Zope 2 using SQLAlchemy? [In reply to]

--On 25. März 2007 23:54:14 +0200 Maciej Wisniowski
<maciej.wisniowski [at] coig> wrote:

>> In the Zope 2 worlds we have dedicated database adapters
>> for different databases. Fortunately the Python world made us a
>> wonderful present called SQLAlchemy that abstracts the different
>> databases. In the Zope world we have some wrappers like
>> z3c.zalchemy and z3c.sqlalchemy... basically they deal with connection
>> handling, mapper handling and integration with the Zope transaction
>> system. Would it make sense to replace all different Zope DAs with
>> a generic DA on top of one of the z3c.* wrappers? I think it would not
>> be too hard to write such a DA...or am I missing something? Thoughts?
>
> Now (in Zope2) we have things like ZOracleDA (DCOracle2), ZPsycopgDA
> etc. that are adapters to these specific databases. They're based on
> Shared/DC/ZRDB/.
> In Zope3 there are also such adapters eg. one using cx_Oracle. They're
> based on Zope3 rdb module.
>
> What do you mean by 'replacing' them? You want wrapper build for
> z3c.* to be used instead of ZRDB (rdb)?
>
> You're talking about Zope2 or Zope3 too?

The subject says Zope 2:-)

-aj


maciej.wisniowski at coig

Mar 25, 2007, 11:55 PM

Post #4 of 12 (2862 views)
Permalink
Re: Unified DA for Zope 2 using SQLAlchemy? [In reply to]

>>
>> Now (in Zope2) we have things like ZOracleDA (DCOracle2), ZPsycopgDA
>> etc. that are adapters to these specific databases. They're based on
>> Shared/DC/ZRDB/.
>> In Zope3 there are also such adapters eg. one using cx_Oracle. They're
>> based on Zope3 rdb module.
>>
>> What do you mean by 'replacing' them? You want wrapper build for
>> z3c.* to be used instead of ZRDB (rdb)?
>>
>> You're talking about Zope2 or Zope3 too?
>
> The subject says Zope 2:-)
A... yes I've missed that :)

So does your proposal is that the only support for RDBMS
in zope 2.x should be via ORM like adapter?
Or this should be something additional to current ZRDB, or
you want to change (simplify?) ZRDB to be similiar to
these z3c wrappers (zope transaction handling, connection pooling etc)?

If you say about going into ORM adapters then few things
I wonder about are calling specific (complicated) queries
and/or stored procedures from databases. How does SQLAlchemy
support this? Another thing, what about speed of ORMs in
comparision to traditional queries with ZSQLMethods?

--
Maciej Wisniowski
_______________________________________________
Zope-DB mailing list
Zope-DB [at] zope
http://mail.zope.org/mailman/listinfo/zope-db


dieter at handshake

Mar 26, 2007, 1:21 PM

Post #5 of 12 (2865 views)
Permalink
Re: Unified DA for Zope 2 using SQLAlchemy? [In reply to]

Andreas Jung wrote at 2007-3-25 17:49 +0200:
>In the Zope 2 worlds we have dedicated database adapters
>for different databases. Fortunately the Python world made us a
>wonderful present called SQLAlchemy that abstracts the different
>databases. In the Zope world we have some wrappers like
>z3c.zalchemy and z3c.sqlalchemy... basically they deal with connection
>handling, mapper handling and integration with the Zope transaction
>system. Would it make sense to replace all different Zope DAs with
>a generic DA on top of one of the z3c.* wrappers? I think it would not
>be too hard to write such a DA...or am I missing something? Thoughts?

As I think I know you a bit, I would expect that you also want
to deprecate the current support and get rid of it altogether
within a year.

This would get an even greater desaster than the tried removal of "zLOG":
huge amounts of applications would stop to work -- and many people
would stop to use new Zope releases.


Otherwise, I would not object against an *additional* SQLAlchemy based
adapter.



--
Dieter
_______________________________________________
Zope-DB mailing list
Zope-DB [at] zope
http://mail.zope.org/mailman/listinfo/zope-db


lists at zopyx

Mar 26, 2007, 1:31 PM

Post #6 of 12 (2858 views)
Permalink
Re: Unified DA for Zope 2 using SQLAlchemy? [In reply to]

--On 26. März 2007 22:21:02 +0200 Dieter Maurer <dieter [at] handshake>
wrote:

> Andreas Jung wrote at 2007-3-25 17:49 +0200:
>> In the Zope 2 worlds we have dedicated database adapters
>> for different databases. Fortunately the Python world made us a
>> wonderful present called SQLAlchemy that abstracts the different
>> databases. In the Zope world we have some wrappers like
>> z3c.zalchemy and z3c.sqlalchemy... basically they deal with connection
>> handling, mapper handling and integration with the Zope transaction
>> system. Would it make sense to replace all different Zope DAs with
>> a generic DA on top of one of the z3c.* wrappers? I think it would not
>> be too hard to write such a DA...or am I missing something? Thoughts?
>
> As I think I know you a bit, I would expect that you also want
> to deprecate the current support and get rid of it altogether
> within a year.

My posting says *nothing* about deprecating something. So __please__
stop reading between the lines when there is nothing - except whitespaces.

>
> This would get an even greater desaster than the tried removal of "zLOG":
> huge amounts of applications would stop to work -- and many people
> would stop to use new Zope releases.
> >

> Otherwise, I would not object against an *additional* SQLAlchemy based
> adapter.

That's *exactly* what I am talking about - an *additional* generic DA
on top of SA where we don't have to care about the different RDBMS
flavours - at least not the ones directly supported through SA.

-aj


charlie at egenix

Mar 26, 2007, 1:38 PM

Post #7 of 12 (2870 views)
Permalink
Re: Unified DA for Zope 2 using SQLAlchemy? [In reply to]

Am 26.03.2007, 22:31 Uhr, schrieb Andreas Jung <lists [at] zopyx>:

> That's *exactly* what I am talking about - an *additional* generic DA
> on top of SA where we don't have to care about the different RDBMS
> flavours - at least not the ones directly supported through SA.

I'm all for an SQLAlchemy DA (does SQLAlchemy support anything other than
PostgreSQL?) and this would help people move from Zope 2 to Zope 3 but it
*cannot* replace the other DA's because of the imperfect nature of SQL and
the even less perfect nature of RDBMs. :-/

Furthermore, there are many occasions where you want the kind of direct
access to a relation you get with the existing DA's.

Charlie

--
Charlie Clark
eGenix.com

Professional Python Services directly from the Source
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::



eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
_______________________________________________
Zope-DB mailing list
Zope-DB [at] zope
http://mail.zope.org/mailman/listinfo/zope-db


maciej.wisniowski at coig

Mar 26, 2007, 1:49 PM

Post #8 of 12 (2868 views)
Permalink
Re: Unified DA for Zope 2 using SQLAlchemy? [In reply to]

> My posting says *nothing* about deprecating something. So __please__
> stop reading between the lines when there is nothing - except whitespaces.
But you said about *replacing* all different zope DAs. So I think
it is not reading between lines.

I agree that this kind of adapter (as additional one) is a nice idea :)

--
Maciej Wisniowski
_______________________________________________
Zope-DB mailing list
Zope-DB [at] zope
http://mail.zope.org/mailman/listinfo/zope-db


lists at zopyx

Mar 26, 2007, 6:02 PM

Post #9 of 12 (2865 views)
Permalink
Re: Unified DA for Zope 2 using SQLAlchemy? [In reply to]

--On 26. März 2007 22:49:21 +0200 Maciej Wisniowski
<maciej.wisniowski [at] coig> wrote:

>> My posting says *nothing* about deprecating something. So __please__
>> stop reading between the lines when there is nothing - except
>> whitespaces.
> But you said about *replacing* all different zope DAs. So I think
> it is not reading between lines.

Well you know that Zope does not skip with any DA (except the one
for Gadyfly). So I am not in the position to replace anything in the Zope
core that does not exist :-) Especially I am not in the position to
replace any third-party products. So my whole posting has absolutely
nothing to with the Zope core. I am just trying to collect feedback - good
or bad - for a such a project - *totally independent* of the Zope 2 core.
I hope this was clear enough - even for Dieter.

> I agree that this kind of adapter (as additional one) is a nice idea :)

Andreas


maciej.wisniowski at coig

Mar 26, 2007, 11:03 PM

Post #10 of 12 (2857 views)
Permalink
Re: Unified DA for Zope 2 using SQLAlchemy? [In reply to]

> Well you know that Zope does not skip with any DA (except the one
> for Gadyfly). So I am not in the position to replace anything in the Zope
> core that does not exist :-)
There is lib/python/shared/DC/ZRDB in the Zope core.
These are generic classes used by almost all thirdparty
database adapters. If you take a look at
lib/python/shared/DC/ZRDB/DA.py even it's docstring says
'Generic Database adapter'.
So at first sight at your post, I (and possibly the others)
understood that you want to do something (replace) with
generic ZRDB module (that definitely exists in zope core).
This would cause thirdparty DAs to break so that is why
you get such comments.

--
Maciej Wisniowski
_______________________________________________
Zope-DB mailing list
Zope-DB [at] zope
http://mail.zope.org/mailman/listinfo/zope-db


dieter at handshake

Mar 27, 2007, 11:13 AM

Post #11 of 12 (2864 views)
Permalink
Re: Unified DA for Zope 2 using SQLAlchemy? [In reply to]

Andreas Jung wrote at 2007-3-27 03:02 +0200:
> ...
>Well you know that Zope does not skip with any DA (except the one
>for Gadyfly). So I am not in the position to replace anything in the Zope
>core that does not exist :-)

You might have attacked "Shared.DC.ZRDB" which is the base of
Z SQL Methods and (the current) DAs.

While it is true that the code there is partially grufty, it is also
vital for many current applications.

Fine, if you just want to contribute an additional way for Zope
to interface with relational databases.



--
Dieter
_______________________________________________
Zope-DB mailing list
Zope-DB [at] zope
http://mail.zope.org/mailman/listinfo/zope-db


lists at zopyx

Apr 30, 2007, 10:15 AM

Post #12 of 12 (2644 views)
Permalink
Re: Unified DA for Zope 2 using SQLAlchemy? [In reply to]

--On 26. März 2007 22:49:21 +0200 Maciej Wisniowski
<maciej.wisniowski [at] coig> wrote:

>> My posting says *nothing* about deprecating something. So __please__
>> stop reading between the lines when there is nothing - except
>> whitespaces.
> But you said about *replacing* all different zope DAs. So I think
> it is not reading between lines.
>
> I agree that this kind of adapter (as additional one) is a nice idea :)

For all who might be interested: there is now something like that
called SQLAlchemyDA:

<http://svn.zope.org/Products.SQLAlchemyDA/trunk/>

It uses my z3c.sqlalchemy implementation. The code quality is still alpha
but good enough to let it work with ZSQL methods (but only roughly tested).

Feedback welcome!
Andreas

Zope db RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.