diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-26 14:47:53 -0600 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-26 14:47:53 -0600 |
commit | d56d420e809588d8dea8f36fd4ae3a8b4204be54 (patch) | |
tree | eeeb939cf4beaae903dcebc24073ff26565a0756 /lib/sqlalchemy/engine/default.py | |
parent | 1a3f424c864d1bbf782db20d0840895c8ae0f35d (diff) | |
download | sqlalchemy-d56d420e809588d8dea8f36fd4ae3a8b4204be54.tar.gz |
mssql+mxodbc should use executedirect for all selects and execute for insert/update/delete. To support this, an is_crud property has been added to the DefaultExecutionContext. The behavior is forcable either way per execution using execution_options(native_odbc_parameters=True|False). Some tests have been added to demonstrate usage. (patch by zzzeek committed by bradallen)
Diffstat (limited to 'lib/sqlalchemy/engine/default.py')
-rw-r--r-- | lib/sqlalchemy/engine/default.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index 720edf66c..6fb0a14a5 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -381,7 +381,10 @@ class DefaultExecutionContext(base.ExecutionContext): self.execution_options = self.execution_options.union(connection._execution_options) self.cursor = self.create_cursor() - + @util.memoized_property + def is_crud(self): + return self.isinsert or self.isupdate or self.isdelete + @util.memoized_property def should_autocommit(self): autocommit = self.execution_options.get('autocommit', |