Skip to content

Commit b2e0cd0

Browse files
committed
Test and docs for timedelta support, refs #522
1 parent 8d186d3 commit b2e0cd0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

docs/python-api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,7 @@ If you pass a Python type, it will be mapped to SQLite types as shown here::
12171217
datetime.datetime: "TEXT"
12181218
datetime.date: "TEXT"
12191219
datetime.time: "TEXT"
1220+
datetime.timedelta: "TEXT"
12201221

12211222
# If numpy is installed
12221223
np.int8: "INTEGER"

tests/test_create.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ def test_create_table_with_not_null(fresh_db):
144144
),
145145
({"uuid": uuid.uuid4()}, [{"name": "uuid", "type": "TEXT"}]),
146146
({"foo[bar]": 1}, [{"name": "foo_bar_", "type": "INTEGER"}]),
147+
(
148+
{"timedelta": datetime.timedelta(hours=1)},
149+
[{"name": "timedelta", "type": "TEXT"}],
150+
),
147151
),
148152
)
149153
def test_create_table_from_example(fresh_db, example, expected_columns):

0 commit comments

Comments
 (0)