Commit 13b45d0c authored by Julien Cigar's avatar Julien Cigar 🤘
Browse files

add support for poolclass

parent 06e57e5d
......@@ -2,6 +2,7 @@
from cherrypy.process import plugins
import sqlalchemy.pool
from sqlalchemy import create_engine, MetaData
from sqlalchemy.orm import scoped_session, sessionmaker
......@@ -61,6 +62,10 @@ class SAEnginePlugin(plugins.SimplePlugin):
if not self.sa_engine:
url = _config['engine'].pop('url')
pool_factory = _config['engine'].pop('poolclass', None)
if pool_factory:
poolclass = getattr(sqlalchemy.pool, pool_factory)
_config['engine']['poolclass'] = poolclass
self.sa_engine = create_engine(url, **_config['engine'])
# Metadata
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment