Michael Van Canneyt wrote:
Plus, and this is really what killed it for me: it does no type
checking.
You can perfectly store a string in an integer field in sqlite;
making it
impossible to use properly with TDataset.
It can be done, but you can get weird errors because
MyIntField.AsInteger will
raise an exception of some other app stored a string in the integer.
Sqlite3 has improved in this field. In the next generation of
TSqlite3Dataset this problem will not occur anymore.
Last time I checked, it was considered a 'feature', so I doubt the
fundamental problem was solved.
I will solve inside TSqlite3Dataset. To see.
I don't see how you can do this ?
What should
FieldByName('Intfield').AsInteger
return if the database contains
'GarbageString'
in the 'IntField' field ?
I dont have the implementations details yet and in fact the viability
depends of the returns of the specific sqlite3 functions. Some research
is necessary to have a better idea of how to do it.
But basically this involves to change the way that the data is stored in
the memory (currently is a PChar, the idea is to move to native types)
and then we have two options:
- When the dataset is open an error is triggered saying "invalid data
in field xxx"
- Ignore it and load NULL or a whatever sqlite3_getint returns
- Setup the database with a strict mode only allowing native types
The priority today is to change the edit/post/cancel behavior and
improve the perfomance a bit.
Luiz
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives