>> Actually, I think TimedeltaCol could be implemented for sqlite as
>> well. Although it doesn't have an INTERVAL data type it could use a
>> plain TEXT instead and python would do the conversion. As far as I
>> know sqlite only knows TEXT anyway so IntCol, StringCol, etc, all
>> these things are implemented as TEXT and the data conversion is done
>> by python. The TimedeltaCol could be similar.
>
> Well, not exactly - SQLite understands and produces some data types -
> pysqlite passes them unmodified AFAIU. But anyway I did a similar trick
> with DecimalStringCol - it stores decimals as strings to work around
> SQLite's "type affinity" feature.
I might be wrong, but from http://www.sqlite.org/datatype3.html I
concluded that sqlite only knows about
* TEXT
* NUMERIC
* INTEGER
* REAL
* NONE
so things like date, datetime and anything else in sqlobject that is
not one of the above 5 types will have to be stored as TEXT. So this
trick of storing complicated python data types as TEXT is already
happening in sqlobject (for example the one you mentioned,
DecimalStringCol). The same thing can be done for the OP's proposed
TimedeltaCol too.
Cheers,
Daniel
--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
|