Felipe Monteiro de Carvalho wrote:

Luiz Americo wrote:

See the topic "Applying changes to the underlying datafile" in the database/sqlite section of the wiki.


Thanks a lot ... I must have missed it ... but then the other databases I worked with (mysql, dbase and ADO) didn´t need this.

Are you saying Delphi or fpc components?

TClientDataset (Delphi) works this way
sqldb (mysql, postgresql, firebird) has similar function although not functional in fpc 2.0.0


One more thing. Do we really need to have a primary field in order to save the database??? I am pretty sure this should not be necessary, as the command line program doesn´t need it. It must be somewere on the API.

It's not necessary. You can use SQL to update your data (through ExecSql), the class give this flexibility.

TSqliteDataset works this way: it keeps data in memory and track the changed records. ApplyUpdates generates SQL commands to save these changes to the database. To insert record is not necessary a primary key, but to update or delete is necessary a way to identify the record and best one is to use a primary key.

The idea is to give a option to work without using sql like a desktop database (in fact is possible to use it without one line of sql) while maintaning the power of sql to who/when is needed with small overhead.

Anyway, is a good practice to add a Primary Key to your data schema

But as i said, is your choice, if you want use sql to update your data ...
Luiz

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to