diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-01-25 17:53:41 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-01-25 17:53:41 -0500 |
| commit | a33c250da273ba9b1c62b5ba6d99914870155faf (patch) | |
| tree | 13742c9b2fa3d77524de83c2f5d58ffa21a7b579 /lib/sqlalchemy/engine/base.py | |
| parent | c3d898e8d06c7e549bb273fc8654f5d24fab2204 (diff) | |
| download | sqlalchemy-a33c250da273ba9b1c62b5ba6d99914870155faf.tar.gz | |
- remove context-specific post-crud logic from Connection and inline post-crud
logic to some degree in DefaultExecutionContext. In particular
we are removing post_insert() which doesn't appear to be used
based on a survey of prominent third party dialects. Callcounts
aren't added to existing execute profiling tests and inserts might be
a little better.
- simplify the execution_options join in DEC. Callcounts don't
appear affected.
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
| -rw-r--r-- | lib/sqlalchemy/engine/base.py | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index fa5dfca9a..aba0d29df 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -1132,31 +1132,12 @@ class Connection(Connectable): if context.compiled: context.post_exec() - if context.isinsert and not context.executemany: - context.post_insert() - - # create a resultproxy, get rowcount/implicit RETURNING - # rows, close cursor if no further results pending - result = context.get_result_proxy() - if context.isinsert: - if context._is_implicit_returning: - context._fetch_implicit_returning(result) - result.close(_autoclose_connection=False) - result._metadata = None - elif not context._is_explicit_returning: + if context.is_crud: + result = context._setup_crud_result_proxy() + else: + result = context.get_result_proxy() + if result._metadata is None: result.close(_autoclose_connection=False) - result._metadata = None - elif context.isupdate and context._is_implicit_returning: - context._fetch_implicit_update_returning(result) - result.close(_autoclose_connection=False) - result._metadata = None - - elif result._metadata is None: - # no results, get rowcount - # (which requires open cursor on some drivers - # such as kintersbasdb, mxodbc), - result.rowcount - result.close(_autoclose_connection=False) if context.should_autocommit and self._root.__transaction is None: self._root._commit_impl(autocommit=True) |
