No, it does not "revert" to string, SQlite just stores the data as it is provided.
As the documentation states:
SQLite supports the concept of "type affinity" on columns. The type affinity of a column is the recommended type for data stored in that column. The important idea here is that the type is recommended, not required. Any column can still store any type of data. It is just that some columns, given the choice, will prefer to use one storage class over another. The preferred storage class for a column is called its "affinity".
If you supplied/bind a text value, it would store a text value. There is no conversion to the type supplied in the CREATE TABLE statement, as it may appear in other more strict RBMS, e.g. MySQL.
So in your case, if you retrieve the data as ftWideString
, I guess this is because you wrote the data as TEXT. For instance, the tool or program creating the SQLite3 content from your MySQL is writing this column as TEXT.
About numbers, there is no "signed"/"unsigned", nor precision check in SQLite3. So if you want to store "unsigned big int" values, just use INTEGER, which are Int64.
But, in all cases, even if SQLite3 API does support UNSIGNED 64 bit integers, this sqlite3_uint64
type may hardly be supported by the Zeos/ZDBC API or by Delphi (older versions of Delphi do NOT support UInt64). To be sure, you should better retrieve such values as TEXT, then convert it as UInt64
manually in your Delphi code.
Update:
Are you using the TDataSet
descendant provided by Zeos? This component is tied to DB.Pas
, so expects a single per-column type. It may be the source of confusion of your code (which you did not show at all, so it is hard to figure out what's happening).
You should better use the lower level ZDBC interface, which allows to retrieve the column type for each row, and call the value getter method as you need.