]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- changelog for pullreq github:125
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 16 Aug 2014 17:57:46 +0000 (13:57 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 16 Aug 2014 17:58:43 +0000 (13:58 -0400)
- add pg8000 version detection for the "sane multi rowcount" feature

doc/build/changelog/changelog_09.rst
lib/sqlalchemy/dialects/postgresql/pg8000.py

index 0f92fb254c549593a4b23bec415e37abb47cae73..b6eec2e9db9c9ec3f5d34278909e3704b74e1963 100644 (file)
 .. changelog::
     :version: 0.9.8
 
+    .. change::
+        :tags: feature, postgresql, pg8000
+        :versions: 1.0.0
+        :pullreq: github:125
+
+        Support is added for "sane multi row count" with the pg8000 driver,
+        which applies mostly to when using versioning with the ORM.
+        The feature is version-detected based on pg8000 1.9.14 or greater
+        in use.  Pull request courtesy Tony Locke.
+
     .. change::
         :tags: bug, engine
         :versions: 1.0.0
index 83e3e6db17e3bd0ead86c52193dee0ae85cbce10..b6f48253d269e342af4cbdfa9b55af1568f3d789 100644 (file)
@@ -133,6 +133,16 @@ class PGDialect_pg8000(PGDialect):
         }
     )
 
+    def initialize(self, connection):
+        if self.dbapi and hasattr(self.dbapi, '__version__'):
+            self._dbapi_version = tuple([
+                int(x) for x in
+                self.dbapi.__version__.split(".")])
+        else:
+            self._dbapi_version = (99, 99, 99)
+        self.supports_sane_multi_rowcount = self._dbapi_version >= (1, 9, 14)
+        super(PGDialect_pg8000, self).initialize(connection)
+
     @classmethod
     def dbapi(cls):
         return __import__('pg8000')