From: Mike Bayer Date: Tue, 20 Sep 2011 16:36:30 +0000 (-0400) Subject: - Added optional "sa_pool_key" argument to X-Git-Tag: rel_0_7_3~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=760060914765c691f62998751383136476c445f4;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Added optional "sa_pool_key" argument to pool.manage(dbapi).connect() so that serialization of args is not necessary. --- diff --git a/CHANGES b/CHANGES index 7c6efecc40..4d16c708dd 100644 --- a/CHANGES +++ b/CHANGES @@ -132,6 +132,10 @@ CHANGES messages use the same improved formatting. [ticket:2243] + - Added optional "sa_pool_key" argument to + pool.manage(dbapi).connect() so that serialization + of args is not necessary. + - types - Extra keyword arguments to the base Float type beyond "precision" and "asdecimal" are ignored; diff --git a/lib/sqlalchemy/pool.py b/lib/sqlalchemy/pool.py index dd945e0740..0bca5f599a 100644 --- a/lib/sqlalchemy/pool.py +++ b/lib/sqlalchemy/pool.py @@ -953,6 +953,9 @@ class _DBProxy(object): pass def _serialize(self, *args, **kw): + if "sa_pool_key" in kw: + return kw['sa_pool_key'] + return tuple( list(args) + [(k, kw[k]) for k in sorted(kw)]