At least with sqlite, datetime columns are treated as datetime objects by table.find() method (which is great!) but as strings by db.query() method (which is bad to me).
I can't figure out why, can anybody help me understand?
with dataset.connect(DATABASE) as db:
print("table.find() method")
for x in db["myTable"].find():
print(type(x['endTime']))
print("db.query() method")
for x in db.query("SELECT * FROM myTable"):
print(type(x['endTime']))
---> <class datetime.datetime> for the first cycle, <class str> for the second one
At least with sqlite, datetime columns are treated as datetime objects by table.find() method (which is great!) but as strings by db.query() method (which is bad to me). I can't figure out why, can anybody help me understand?
--->
<class datetime.datetime>
for the first cycle,<class str>
for the second one