diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-08-09 23:46:06 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-08-09 23:46:06 +0000 |
commit | d564baf593311ca5bc62dbc401e57986bf9169ba (patch) | |
tree | 11a278cb89481ca6d775971ff6ee07c2701f8008 /lib/sqlalchemy/sql/compiler.py | |
parent | f0d2e599b60317fc27f64f0abe7d2af65fba7e7b (diff) | |
download | sqlalchemy-d564baf593311ca5bc62dbc401e57986bf9169ba.tar.gz |
- the Oracle dialect now features NUMBER which intends
to act justlike Oracle's NUMBER type. It is the primary
numeric type returned by table reflection and attempts
to return Decimal()/float/int based on the precision/scale
parameters. [ticket:885]
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index d6187bcde..403ec968b 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1149,6 +1149,8 @@ class GenericTypeCompiler(engine.TypeCompiler): def visit_NUMERIC(self, type_): if type_.precision is None: return "NUMERIC" + elif type_.scale is None: + return "NUMERIC(%(precision)s)" % {'precision': type_.precision} else: return "NUMERIC(%(precision)s, %(scale)s)" % {'precision': type_.precision, 'scale' : type_.scale} |