Menu

TDatabase

Teo Fonrouge

TDatabase Class

This class holds information about the tables in the Database: directory, driver, relations and table dependencies.

Public Method's

AddParentChild()

Adds to the Database a new parent->child table relation.

Syntax:

AddParentChild( \<parentTableName>, \<childTableName>, [indexName], [virtual = .F.], [autoDelete = .F.] ) -> Self

Arguments:

\<parentTableName>: The Parent class table name

\<childTableName>: The class table name of the Child

[indexName]: The optional index used to establish the relation

[virtual]: Optional flag to set the relation as virtual (you can't create a instance but verify the parent - child relation)

[autoDelete]: Optional flag that permits to delete Child table rows without asking permission

Returns:

The TDatabase object.


cmdAddTable()

( tableName, indexName, virtual, autoDelete )


cmdDefineChild()

()


cmdEndChild()

()


GetParentChildList()

( tableName, Result )


TableIsChildOf()

( table, fromTable )



Property's:

ChildParentList (read only)

ParentChildList (read only)

TableList


Property Values:

Directory
Syntax:

PROPERTY Directory VALUE \<directoryPath>


TableAutoCreate

Flag used as default for the Table AutoCreate Property Value on each one of the Tables registered in this TDatabase object.

Syntax:

PROPERTY TableAutoCreate VALUE \<tableAutoCreateFlag>


Example:

  {
    int i;
    bool y;
  }
  PROPERTY Directory VALUE "my/path/directory"

:::python
Code goes here


COMMAND's

DEFINE RELATIONS
BEGIN RELATIONS CLASS ... END RELATIONS CLASS