summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-01-23 19:44:06 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2010-01-23 19:44:06 +0000
commitfc92d14bbe3077ff94df108bf53ec77e0da83dd8 (patch)
treea893a688e404966a1727477580425e95cb7f1236 /lib/sqlalchemy/sql/compiler.py
parent2d15d9b0d0b20190d5aa348edaf4b398263464f7 (diff)
downloadsqlalchemy-fc92d14bbe3077ff94df108bf53ec77e0da83dd8.tar.gz
- 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].
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py8
1 files changed, 7 insertions, 1 deletions
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_):