mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
Test and docs for timedelta support, refs #522
This commit is contained in:
parent
8d186d33c2
commit
b2e0cd066d
2 changed files with 5 additions and 0 deletions
|
|
@ -1217,6 +1217,7 @@ If you pass a Python type, it will be mapped to SQLite types as shown here::
|
|||
datetime.datetime: "TEXT"
|
||||
datetime.date: "TEXT"
|
||||
datetime.time: "TEXT"
|
||||
datetime.timedelta: "TEXT"
|
||||
|
||||
# If numpy is installed
|
||||
np.int8: "INTEGER"
|
||||
|
|
|
|||
|
|
@ -144,6 +144,10 @@ def test_create_table_with_not_null(fresh_db):
|
|||
),
|
||||
({"uuid": uuid.uuid4()}, [{"name": "uuid", "type": "TEXT"}]),
|
||||
({"foo[bar]": 1}, [{"name": "foo_bar_", "type": "INTEGER"}]),
|
||||
(
|
||||
{"timedelta": datetime.timedelta(hours=1)},
|
||||
[{"name": "timedelta", "type": "TEXT"}],
|
||||
),
|
||||
),
|
||||
)
|
||||
def test_create_table_from_example(fresh_db, example, expected_columns):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue