[Zope-Annce] SQLAlchemy 0.2 released - a generic database adapter
for Zope 2
Andreas Jung
lists at zopyx.com
Sat May 5 09:45:39 EDT 2007
I am pleased to announce the first public release of
SQLAlchemyDA V 0.2.0
Download:
---------
<http://opensource.zopyx.com/software/sqlalchemyda/releases/0.2.0>
What is SQLAlchemyDA?
---------------------
SQLAlchemyDA is both a tiny frontend to the z3c.sqlalchemy SQLAlchemy
package for Zope 2 and Zope 3. In addition it acts as a database adapter
for ZSQL methods. Since it is based on SQLAlchemy, SQLAlchemy supports all
databases out-of-the box that are supported by SQLAlchemy.
Requirements:
-------------
- Zope 2.8 +
- SQLAlchemy 0.3.X
- z3c.sqlalchemy 1.0.0 +
Installation:
-------------
- download and install z3c.sqlalchemy as egg or from the sources
from Cheeseshop (easy_install z3c.sqlalchemy)
- A z3c.sqlAlchemy SAWrapper must be registered. The best way to do this
right now to put something like this into your Product's initialize():
Products/YourProduct/__init__.py:
def initialize(context):
from z3c.sqlalchemy import createSAWrapper, registerSAWrapper
wrapper =
createSAWrapper('postgres://user:password@host/database', forZope=True)
registerSAWrapper(wrapper, 'my-sa-wrapper')
- After restarting Zope you go to the ZMI and create an instance of
"SQLAlchemy Wrapper Integration" (as you would create some DA instance).
After creating the instance you should see 'my-sa-wrapper' in the
properties form of the new instance. When creating a new ZSQL method
you should be able to use this DA instance as connection id.
Using SQLAlchemyDA:
-------------------
- for using SQLAlchemyDA through object mappers as used in SQLAlchemy
you can use the getMapper() and getMappers() methods. Check
the z3c.sqlchemy documentation for details. A SQLAlchemy Session object
can be obtained by the getSession() method. Sessions are integrated
with Zope 2 transaction management.
- a SQLAlchemyDA instance can be used as a standard DA together with
ZSQL methods.
WARNING: YOU SHOULD NOT USE ZSQL METHODS AND MAPPERS WITHIN THE SAME
REQUEST!!!
Mappers/Sessions and Connections (for ZSQL methods) are totally
independent and have their own transaction. Mixing both would
result in two distinct transactions leading to unpredictable results.
License
=======
SQLAlchemyDA is licensed under the Zope Public License 2.1.
See LICENSE.txt.
Andreas Jung
--
ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: info at zopyx.com - Phone +49 - 7071 - 793376
Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK
------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-announce/attachments/20070505/75a71930/attachment.bin
More information about the Zope-Announce
mailing list