]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Type processors get a dialect, not an engine...
authorJason Kirtland <jek@discorporate.us>
Wed, 27 Aug 2008 19:10:03 +0000 (19:10 +0000)
committerJason Kirtland <jek@discorporate.us>
Wed, 27 Aug 2008 19:10:03 +0000 (19:10 +0000)
doc/build/content/types.txt

index f504f297a1ff764c19a034efce5df3815e58dce5..2fdf424eae8a201aed152c9e31d91ae1b8f512df 100644 (file)
@@ -119,10 +119,10 @@ User-defined types can be created which can augment the bind parameter and resul
         
         impl = types.Unicode
         
-        def process_bind_param(self, value, engine):
+        def process_bind_param(self, value, dialect):
             return "PREFIX:" + value
             
-        def process_result_value(self, value, engine):
+        def process_result_value(self, value, dialect):
             return value[7:]
         
         def copy(self):
@@ -144,10 +144,10 @@ To build a type object from scratch, which will not have a corresponding databas
         def get_col_spec(self):
             return "MYTYPE(%s)" % self.precision
             
-        def convert_bind_param(self, value, engine):
+        def convert_bind_param(self, value, dialect):
             return value
             
-        def convert_result_value(self, value, engine):
+        def convert_result_value(self, value, dialect):
             return value
 
 Once you make your type, it's immediately useable: