]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- duh, compiled is per dialect
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 19 Dec 2010 21:01:40 +0000 (16:01 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 19 Dec 2010 21:01:40 +0000 (16:01 -0500)
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/sql/compiler.py

index ae0625d30feb5aee7cbfbb987081c39f312aedee..38ff76b89307f279eab880baeb9e9a3a270f67a5 100644 (file)
@@ -403,7 +403,7 @@ class DefaultExecutionContext(base.ExecutionContext):
             self.postfetch_cols = self.compiled.postfetch
             self.prefetch_cols = self.compiled.prefetch
         
-        processors = compiled._get_bind_processors(dialect)
+        processors = compiled._bind_processors
 
         # Convert the dictionary of bind parameter values 
         # into a dict or list to be sent to the DBAPI's 
index 0c76f3e74fd792deea016dbaa377ae20221fe746..4c1fefa553323f13c5aebb487656dc571b0ffb93 100644 (file)
@@ -251,24 +251,16 @@ class SQLCompiler(engine.Compiled):
         # or dialect.max_identifier_length
         self.truncated_names = {}
         
-        # other memoized things
-        self._memos ={}
 
-    def _get_bind_processors(self, dialect):
-        key = 'bind_processors', dialect.__class__, \
-                    dialect.server_version_info
-        
-        if key not in self._memos:
-            self._memos[key] = processors = dict(
+    @util.memoized_property
+    def _bind_processors(self):
+        return dict(
                 (key, value) for key, value in
                 ( (self.bind_names[bindparam],
-                   bindparam.type._cached_bind_processor(dialect))
+                   bindparam.type._cached_bind_processor(self.dialect))
                   for bindparam in self.bind_names )
                  if value is not None
             )
-            return processors
-        else:
-            return self._memos[key]
         
     def is_subquery(self):
         return len(self.stack) > 1