I coded a module that has a ChineseDate class, which automatically parse
Chinese dates characters into a python-dateutil object(which actually is a
datetime.datetime object as well).
I used detect_types=sqlite3.PARSE_DECLTYPES to tell the connection object
to store this ChineseDate type directly into one column in my schema. When
inserted into that column, the python ChineseDate object will be
automatically adapted into a complex string, containing the first occuring
date and the interval, etc. Now I want to select all the records with their
MyDate column later than a certain 兔年八月十五, so I built this query:
SELECT * FROM myTable WHERE MyDate > MyModule.ChineseDate("兔年八月十五")
This comparison is legal in the pure Python context because both sides are
a ChineseDate instance. But for some reason I got an
sqlite3.operationalError from running it.
Am I in the wrong path to achieve my goal?
Or more generally, *is this kind of in-place comparison of two native
python objects supported in sqlite3 WHERE clause*?
Or it is not supported at all. WHERE A >= B, A and B must be BOTH dates or
integers or strings ONLY and no other custom types?
Many thanks.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to