summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-12-08 11:23:21 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2012-12-08 11:23:21 -0500
commit1ee4736beaadeb9053f8886503b64ee04fa4b557 (patch)
treee67e2b6347a11a5eef84ff11d76c142ba53b10ff /lib/sqlalchemy/sql/compiler.py
parentd57c1c2ddd654a1077ab04ba7277828d9030c23d (diff)
parentf8caf05593a00a61d5ef6467c334c1e594fbae86 (diff)
downloadsqlalchemy-1ee4736beaadeb9053f8886503b64ee04fa4b557.tar.gz
merge latest default
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 3856499fc..b7dc03414 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -2100,7 +2100,15 @@ class GenericTypeCompiler(engine.TypeCompiler):
'scale': type_.scale}
def visit_DECIMAL(self, type_):
- return "DECIMAL"
+ if type_.precision is None:
+ return "DECIMAL"
+ elif type_.scale is None:
+ return "DECIMAL(%(precision)s)" % \
+ {'precision': type_.precision}
+ else:
+ return "DECIMAL(%(precision)s, %(scale)s)" % \
+ {'precision': type_.precision,
+ 'scale': type_.scale}
def visit_INTEGER(self, type_):
return "INTEGER"