From fc92d14bbe3077ff94df108bf53ec77e0da83dd8 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 23 Jan 2010 19:44:06 +0000 Subject: - types.Binary is renamed to types.LargeBinary, it only produces BLOB, BYTEA, or a similar "long binary" type. New base BINARY and VARBINARY types have been added to access these MySQL/MS-SQL specific types in an agnostic way [ticket:1664]. --- lib/sqlalchemy/sql/compiler.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 2d099e9d5..e635e20e1 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1217,6 +1217,12 @@ class GenericTypeCompiler(engine.TypeCompiler): def visit_BLOB(self, type_): return "BLOB" + + def visit_BINARY(self, type_): + return "BINARY" + (type_.length and "(%d)" % type_.length or "") + + def visit_VARBINARY(self, type_): + return "VARBINARY" + (type_.length and "(%d)" % type_.length or "") def visit_BOOLEAN(self, type_): return "BOOLEAN" @@ -1224,7 +1230,7 @@ class GenericTypeCompiler(engine.TypeCompiler): def visit_TEXT(self, type_): return "TEXT" - def visit_binary(self, type_): + def visit_large_binary(self, type_): return self.visit_BLOB(type_) def visit_boolean(self, type_): -- cgit v1.2.1