[Zope3-Users] Zope3 and SQLAlchemy
kevin gill
kevin at movieextras.ie
Tue Nov 18 08:35:58 EST 2008
I investigated these last month.
At the high-level there are two options, ORM or Direct SQL.
If you are going down the route of ORM, there are two well supported and
active ORMs, SQLAlchemy and Storm.
If you are going with alchemy, there are several options. I made a few
notes as I was looking at them. For my purposes ore.alchemist and storm
suited best. Here are my notes...
dobbin:
- Works like ZODB
- Creates tables on the fly
- No control over the schema
- built on ore.alchemist
- I failed to get this working. The documentation is not
ZCML friendly. The connection mechanism is undocumented.
It requires that UUID functionality is installed in
postgreSQL.
z3c.sqlalchemy
- intergrates zope.sqlalchemy (see below)
- provides a configuration mechanism
- No integration to interfaces
z3c.zalchemy (abandoned)
- Integration of SQLAlchemy to Zope Transactions
- Integration of interfaces - objects work like zope objects
collective.lead
- See Martin Aspellis book
- Not zope objects (plone - archetypes)
- see zope.sqlalchemy below
zope.sqlalchemy
- attempt to unify the integration of SQLAlchemy to the Zope
transaction management machinery
- Allows sqlalchemy to work in a Zope instance.
- provides NO configuration mechanism
z3c.saconfig
- layer to provide 'scoped session support' on top of
zope.sqlalchemy
- SQLAlchemy session factory is a zope utility
- Note: you cannot connect to the database during the
xmlconfig pass.
<include package="z3c.saconfig" file="meta.zcml" />
<db:engine
url="posgres://name:pass@localhost/databasename"
echo="True"
/>
<db:session
twophase="True"
/>
ore.alchemist
- of the alchemy ORM approaches, this worked best for me
- simple container based mechanism for mapping a file to the ORM
- 'bind' meta directive controls meta-data lookup after
database connect
Also, if you are going with SQL database only, have a look at lovey.zetup.
This provides a ZODB'less mechanims for building your site.
I hope this helps,
Kevin
> Hi,
>
> I currently have to integrate an SQL database (PostgreSQL, with PostGIS
> extensions) into my Zope3 application.
> I'd like to use SQLAlchemy to handle this, and I've seen that several
> packages are available : z3c.zalchemy, z3c.sqlalchemy,
> zope.sqlalchemy...
>
> So my questions are simple :
> - what package is the best to plug into my Zope (3.3.1) application ?
> - do all these packages handle the same features ??
>
> Thanks for any information,
>
> Thierry Florac
> --
> Chef de projet intranet/internet
> Office National des Forêts - Département Informatique
> 2, Avenue de Saint-Mandé
> 75570 PARIS Cedex 12
> Mél : thierry.florac at onf.fr
> Tél. : +33 01.40.19.59.64
> Fax. : +33 01.40.19.59.85
>
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
>
> --
> ** Email Scanned by Elive's Virus Scanning Service -
> http://www.elive.net **
>
>
>
>
>
More information about the Zope3-users
mailing list