Difference between revisions of "TGTable"

From Gestinux Wiki
Jump to navigation Jump to search
Line 1: Line 1:
TGTable is not used to store or retrieve data.
+
 
 +
== Purpose ==
  
 
This component is only used to store table metadata : description, fields, index, constraints.
 
This component is only used to store table metadata : description, fields, index, constraints.
 +
 +
TGTable is not used to store or retrieve data.
  
 
== To create a new table ==
 
== To create a new table ==

Revision as of 23:07, 17 October 2012

Purpose

This component is only used to store table metadata : description, fields, index, constraints.

TGTable is not used to store or retrieve data.

To create a new table

This is for a new functionnality in the application (only in the trunk version).

  • Create the table and all it's index and constraints with MySql Query Browser or any other MySql client (not PostgreSQL).
    • The following types can be used only. If other types are necessary, some development must be done.
      • Integer Autoinc
      • Integer, smallint
      • Varchar
      • Timestamp
      • Date, Datetime
      • Blob
    • Always start with an Id field, Autoinc and Primary key
    • Always end with an UpdateDate field, TimeStamp default current_timestamp on update current_timestamp
  • Create a TGTable object in Datamodule, with connexion set to open the previous database.
    • Create a new computed field AutoInc, correct it's Name (bug), set it Required and set the field to fkData.
    • Add all other fields.
    • Write the index and constraint instructions in the property Properties of the TGTable.
    • In DataModule1.DbAfterConnect event, add to TGTable.Check.
  • Test it and check the structure and data created in the query browser !