diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-09-14 16:45:46 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-09-14 16:45:46 +0000 |
| commit | cc88f1e8c358e63733a02ceea5e1323bcd9c3455 (patch) | |
| tree | 092a6047e4764a0bdf8207cafec0c196cbb7bd98 /lib/sqlalchemy/engine | |
| parent | 3dd5d834ad6d3ae7f515ff20f3b8756d46e2347f (diff) | |
| download | sqlalchemy-cc88f1e8c358e63733a02ceea5e1323bcd9c3455.tar.gz | |
- added an implicit close() on the cursor in ResultProxy
when the result closes
- added scalar() method to ComposedSQLEngine
Diffstat (limited to 'lib/sqlalchemy/engine')
| -rw-r--r-- | lib/sqlalchemy/engine/base.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index fad84eef8..cf321bca2 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -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() |
