[Checkins] SVN: Products.SQLAlchemyDA/trunk/README.txt updatefd
Andreas Jung
andreas at andreas-jung.com
Thu Jun 7 05:52:08 EDT 2007
Log message for revision 76452:
updatefd
Changed:
U Products.SQLAlchemyDA/trunk/README.txt
-=-
Modified: Products.SQLAlchemyDA/trunk/README.txt
===================================================================
--- Products.SQLAlchemyDA/trunk/README.txt 2007-06-07 09:46:16 UTC (rev 76451)
+++ Products.SQLAlchemyDA/trunk/README.txt 2007-06-07 09:52:07 UTC (rev 76452)
@@ -32,40 +32,18 @@
- 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():
+ - After restarting Zope you go to the ZMI and create an instance of
+ "SQLAlchemyDA" (as you would create some DA instance)
- Products/YourProduct/__init__.py:
+ - click on the new created SQLAlchemyDA instance within the ZMI
+ and configure your database connection through the "Properties" tab.
+ The connection parameter 'dsn' must be specified as a valid SQLAlchemy DSN
+ like
- def initialize(context):
+ <dbschema>://<username>:<password>@<hostname>/<databasename>
- from z3c.sqlalchemy import createSAWrapper
- wrapper = createSAWrapper('postgres://user:password@host/database',
- forZope=True,
- name='my-sa-wrapper')
- If you have trouble with the number of connections (5 by default + 10 threshold) you must
- customize the connection pool:
- from sqlalchemy.pool import QueuePool
- from z3c.sqlalchemy import createSAWrapper
-
- wrapper = createSAWrapper('postgres://user:password@host/database',
- poolclass=QueuePool,
- pool_size=20,
- max_overflow=10,
- forZope=True)
-
-
-
-
- - After restarting Zope you go to the ZMI and create an instance of
- "SQLAlchemyDA" (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:
-------------------
More information about the Checkins
mailing list