[Lazarus] SQLiteDataSet Patch

Luiz Americo Pereira Camara luizmed at oi.com.br
Wed Mar 17 22:27:20 CET 2010


Guionardo Furlan escreveu:
> Hello, source-owners 
>
> I''ve made a change in the *CreateTable* method of the 
> *TCustomSqliteDataset *class to include the *AutoInc *field type 
> working ok. 
> The current implementation don't of the type ftAutoInc doesn't work.
>
> This is the source on the file *CustomSQLiteDS.pas*
> *
> *
> *Could this be updated in the sources?*

Hi, ftAutoInc field is a type that is incremented at TSqliteDataset side 
so there's no need to set  in sqlite field name.
But why not use the field type you propose (INTEGER AUTOINC)?

1. It will not be possible to determine that's an ftAutoInc field when 
dataset is loaded because it's recognized as INTEGER
2. It's already possible to get the behavior you want:
  - Set PrimaryKey to your integer field
  - (Optional) If you want that this field is autoincremented in 
TSqliteDataset side set AutoIncrementKey to true
  - The table will be created with a INTEGER PRIMARY KEY field that by 
definition is an autoincrement field. See the sqlite.org FAQ

Luiz




More information about the Lazarus mailing list