> On 19 Sep 2018, at 05:23, Konstantin Osipov wrote: > > * Nikita Pettik > [18/09/18 01:20]: >> From: Georgy Kirichenko >> >> As a main part of introducing strict typing in SQL it is required to >> prohibit typeless columns in parser's grammar. Originally, SQLite simply >> assigns typeless columns to BLOB affinity. Moreover, due to historical >> reasons, all columns were stored with type in Tarantool core >> (except for when it comes to primary key). Column type should >> be defined on table creation. Allowed data types are: , , >> , , , , , , , >> and . However, still any declared data type is >> converted to one of , , or affinities. >> While affinity reaches space format, it is (again) converted to >> Tarantool's field type. To be more precise, table of conversions: >> >> +----------+----------+------------+ >> | SQL TYPE | AFFINITY | FIELD TYPE | >> +----------+----------+------------+ >> | FLOAT | REAL | NUMBER | >> | REAL | REAL | NUMBER | >> | DOUBLE | REAL | NUMBER | >> | NUMERIC | REAL | NUMBER | >> | DECIMAL | REAL | NUMBER | >> | INTEGER | INTEGER | INTEGER | >> | TEXT | TEXT | STRING | >> | VARCHAR | TEXT | STRING | >> | CHAR | TEXT | STRING | >> | BLOB | BLOB | SCALAR | >> | DATETIME | REAL | NUMBER | >> | DATE | REAL | NUMBER | >> | TIME | REAL | NUMBER | >> +----------+----------+------------+ > > How do you manage to store datetime/date/time values as numbers? > What is your conversion procedure? Are you storing it as unix > timestamp? Note that SQL date begins (AFAIR) at 1900-01-01. Now we don’t have any facilities to process or store DATETIME format in any convenient way. SQLite originally only features DATETIME() function, which converts string to REAL type (in the same way you mentioned). Hence, temporary this ’type’ works simply as REAL/FLOAT without any implicit conversions to unix timestamp or date/time validations. Another option is remove DATETIME type at all - until it will be implemented, in order to avoid confusions.