add_column now accepts explicit SQLite types, refs #15

This commit is contained in:
Simon Willison 2019-02-24 11:49:24 -08:00
commit 6d25f648ed
3 changed files with 25 additions and 1 deletions

View file

@ -30,6 +30,15 @@ COLUMN_TYPE_MAPPING = {
datetime.date: "TEXT",
datetime.time: "TEXT",
None.__class__: "TEXT",
# SQLite explicit types
"TEXT": "TEXT",
"INTEGER": "INTEGER",
"FLOAT": "FLOAT",
"BLOB": "BLOB",
"text": "TEXT",
"integer": "INTEGER",
"float": "FLOAT",
"blob": "BLOB",
}
# If numpy is available, add more types
if np: