]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- added an implicit close() on the cursor in ResultProxy
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 14 Sep 2006 16:45:46 +0000 (16:45 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 14 Sep 2006 16:45:46 +0000 (16:45 +0000)
when the result closes
- added scalar() method to ComposedSQLEngine

CHANGES
lib/sqlalchemy/engine/base.py

diff --git a/CHANGES b/CHANGES
index 3f664c498927807bce854f2bf6ad2077b56d6edb..bf64c367d993b1b53a522c588c81f49c6717c44c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -16,6 +16,9 @@ is used to get() an instance thats already loaded
 - fixed bug where Connection wouldnt lose its Transaction
 after commit/rollback
 - added extract() function to sql dialect
+- added an implicit close() on the cursor in ResultProxy
+when the result closes
+- added scalar() method to ComposedSQLEngine
 
 0.2.8
 - cleanup on connection methods + documentation.  custom DBAPI
index fad84eef864dd5cd97cc0bc5b540374e225642a2..cf321bca2bd8e5157c9b852bfe3763ff735e252e 100644 (file)
@@ -466,6 +466,10 @@ class ComposedSQLEngine(sql.Engine, Connectable):
     def execute(self, statement, *multiparams, **params):
         connection = self.contextual_connect(close_with_result=True)
         return connection.execute(statement, *multiparams, **params)
+
+    def scalar(self, statement, *multiparams, **params):
+        connection = self.contextual_connect(close_with_result=True)
+        return connection.scalar(statement, *multiparams, **params)
         
     def execute_compiled(self, compiled, *multiparams, **params):
         connection = self.contextual_connect(close_with_result=True)
@@ -564,6 +568,7 @@ class ResultProxy:
     def close(self):
         if not self.closed:
             self.closed = True
+            self.cursor.close()
             if self.connection.should_close_with_result and self.dialect.supports_autoclose_results:
                 self.connection.close()