Sqlite autoloading of float turns to numeric

Issue #1273 resolved
Former user created an issue

The following code demonstrates that float field of sqlite are detected as SLNumeric when autoloading::

from sqlalchemy import *

bind = "sqlite:///ex.sqlite"
meta = MetaData(bind=bind)


table = Table('test', meta,  Column('float_field', Float))
meta.create_all()
print table.c['float_field']('float_field').type

meta2 = MetaData(bind=bind)
table_autoload = Table('test', meta2, autoload=True)
print table_autoload.c['float_field']('float_field').type

The output is

Float(precision=10, asdecimal=False)
SLNumeric(precision=10, scale=2, asdecimal=True, length=None)

Comments (3)

  1. Log in to comment