diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-13 00:15:32 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-13 00:15:32 -0500 |
| commit | 86e8e7c558b296018613ed979012b2aca493ffbb (patch) | |
| tree | 62340b7d477c59d9ba7c2c2cad488652176188d8 /lib/sqlalchemy/engine/default.py | |
| parent | 1125a4b8b1a7b41111396b5b58887047a847b59e (diff) | |
| download | sqlalchemy-86e8e7c558b296018613ed979012b2aca493ffbb.tar.gz | |
- why type.dialect_impl(dialect).bind_processor(dialect), caching just the impl?
just call type._cached_bind_processor(dialect), cache the impl *and* the processor function.
same for result sets.
- use plain dict + update for defaultexecutioncontext.execution_options
Diffstat (limited to 'lib/sqlalchemy/engine/default.py')
| -rw-r--r-- | lib/sqlalchemy/engine/default.py | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index 22fff3312..8647ba385 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -307,7 +307,6 @@ class DefaultDialect(base.Dialect): class DefaultExecutionContext(base.ExecutionContext): - execution_options = util.frozendict() isinsert = False isupdate = False isdelete = False @@ -329,12 +328,10 @@ class DefaultExecutionContext(base.ExecutionContext): self.compiled = compiled = compiled_ddl self.isddl = True - if compiled.statement._execution_options: - self.execution_options = compiled.statement._execution_options + self.execution_options = compiled.statement._execution_options if connection._execution_options: - self.execution_options = self.execution_options.union( - connection._execution_options - ) + self.execution_options = dict(self.execution_options) + self.execution_options.update(connection._execution_options) if not dialect.supports_unicode_statements: self.unicode_statement = unicode(compiled) @@ -366,12 +363,10 @@ class DefaultExecutionContext(base.ExecutionContext): if not compiled.can_execute: raise exc.ArgumentError("Not an executable clause: %s" % compiled) - if compiled.statement._execution_options: - self.execution_options = compiled.statement._execution_options + self.execution_options = compiled.statement._execution_options if connection._execution_options: - self.execution_options = self.execution_options.union( - connection._execution_options - ) + self.execution_options = dict(self.execution_options) + self.execution_options.update(connection._execution_options) # compiled clauseelement. process bind params, process table defaults, # track collections used by ResultProxy to target and process results @@ -451,9 +446,7 @@ class DefaultExecutionContext(base.ExecutionContext): self.engine = connection.engine # plain text statement - if connection._execution_options: - self.execution_options = self.execution_options.\ - union(connection._execution_options) + self.execution_options = connection._execution_options if not parameters: if self.dialect.positional: @@ -493,9 +486,7 @@ class DefaultExecutionContext(base.ExecutionContext): self.dialect = dialect self._connection = self.root_connection = connection self.engine = connection.engine - if connection._execution_options: - self.execution_options = self.execution_options.\ - union(connection._execution_options) + self.execution_options = connection._execution_options self.cursor = self.create_cursor() return self |
