.. changelog::
:version: 0.8.5
+ .. change::
+ :tags: bug, firebird
+ :versions: 0.9.0b2
+
+ The "asdecimal" flag used with the :class:`.Float` type will now
+ work with Firebird dialects; previously the decimal conversion was
+ not occurring.
+
.. change::
:tags: bug, mssql, pymssql
:versions: 0.9.0b2
import decimal
-class _FBNumeric_kinterbasdb(sqltypes.Numeric):
+class _kinterbasdb_numeric(object):
def bind_processor(self, dialect):
def process(value):
if isinstance(value, decimal.Decimal):
return value
return process
+class _FBNumeric_kinterbasdb(_kinterbasdb_numeric, sqltypes.Numeric):
+ pass
+
+class _FBFloat_kinterbasdb(_kinterbasdb_numeric, sqltypes.Float):
+ pass
+
class FBExecutionContext_kinterbasdb(FBExecutionContext):
@property
FBDialect.colspecs,
{
sqltypes.Numeric: _FBNumeric_kinterbasdb,
+ sqltypes.Float: _FBFloat_kinterbasdb,
}
)
]
)
+ @property
+ def precision_generic_float_type(self):
+ """target backend will return native floating point numbers with at
+ least seven decimal places when using the generic Float type."""
+
+ return fails_if([
+ ('mysql', None, None,
+ 'mysql FLOAT type only returns 4 decimals'),
+ ('firebird', None, None,
+ "firebird FLOAT type isn't high precision"),
+ ])
+
+ @property
+ def floats_to_four_decimals(self):
+ return fails_if([
+ ("mysql+oursql", None, None, "Floating point error"),
+ ("firebird", None, None,
+ "Firebird still has FP inaccuracy even "
+ "with only four decimal places")
+ ])
@property
def python2(self):