summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-12-13 00:15:32 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2010-12-13 00:15:32 -0500
commit86e8e7c558b296018613ed979012b2aca493ffbb (patch)
tree62340b7d477c59d9ba7c2c2cad488652176188d8 /lib/sqlalchemy/engine
parent1125a4b8b1a7b41111396b5b58887047a847b59e (diff)
downloadsqlalchemy-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')
-rw-r--r--lib/sqlalchemy/engine/base.py5
-rw-r--r--lib/sqlalchemy/engine/default.py25
2 files changed, 10 insertions, 20 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py
index 00aaca01e..f3f32f833 100644
--- a/lib/sqlalchemy/engine/base.py
+++ b/lib/sqlalchemy/engine/base.py
@@ -701,7 +701,7 @@ class Compiled(object):
"""Return the string text of the generated SQL or DDL."""
return self.string or ''
-
+
def construct_params(self, params=None):
"""Return the bind params for this compiled object.
@@ -2221,8 +2221,7 @@ class ResultMetaData(object):
name, obj, type_ = \
colname, None, typemap.get(coltype, types.NULLTYPE)
- processor = type_.dialect_impl(dialect).\
- result_processor(dialect, coltype)
+ processor = type_._cached_result_processor(dialect, coltype)
processors.append(processor)
rec = (processor, i)
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