You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/agateau/tmp/sqliteutilsfloat.py", line 4, in <module>
db["test"].create({"frequency": float}, strict=True)
File "/home/agateau/.local/share/virtualenvs/40d64b18be55921/lib/python3.10/site-packages/sqlite_utils/db.py", line 1689, in create
self.db.create_table(
File "/home/agateau/.local/share/virtualenvs/40d64b18be55921/lib/python3.10/site-packages/sqlite_utils/db.py", line 1070, in create_table
self.execute(sql)
File "/home/agateau/.local/share/virtualenvs/40d64b18be55921/lib/python3.10/site-packages/sqlite_utils/db.py", line 526, in execute
return self.conn.execute(sql)
sqlite3.OperationalError: unknown datatype for test.frequency: "FLOAT"
According to sqlite doc, the type for floats should be REAL. To verify this I modified db.py so that COLUMN_TYPE_MAPPING would return "REAL" for float. With this modification the example snippet runs.
The text was updated successfully, but these errors were encountered:
Trying to create a table with float columns fails when strict mode is enabled.
Running this snippet:
Causes this error:
According to sqlite doc, the type for floats should be
REAL
. To verify this I modified db.py so thatCOLUMN_TYPE_MAPPING
would return"REAL"
forfloat
. With this modification the example snippet runs.The text was updated successfully, but these errors were encountered: