]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
firebird: Fixed reflection for Integer and Numeric (after introducing Float column...
authorRoger Demetrescu <roger.demetrescu@gmail.com>
Fri, 12 Oct 2007 12:53:33 +0000 (12:53 +0000)
committerRoger Demetrescu <roger.demetrescu@gmail.com>
Fri, 12 Oct 2007 12:53:33 +0000 (12:53 +0000)
lib/sqlalchemy/databases/firebird.py

index a427c72203c1f1d097945ff79b341e66717c4549..71c2d3df0f016062b1111dacfd769c8ee5b744ec 100644 (file)
@@ -223,7 +223,7 @@ class FBDialect(default.DefaultDialect):
         column_func = {
             14 : lambda r: sqltypes.String(r['FLEN']), # TEXT
             7  : lambda r: sqltypes.Integer(), # SHORT
-            8  : lambda r: sqltypes.Integer(), # LONG
+            8  : lambda r: r['FPREC']==0 and sqltypes.Integer() or sqltypes.Numeric(precision=r['FPREC'], length=r['FSCALE'] * -1),  #INT or NUMERIC
             9  : lambda r: sqltypes.Float(), # QUAD
             10 : lambda r: sqltypes.Float(), # FLOAT
             27 : lambda r: sqltypes.Float(), # DOUBLE