Schema Object

The Schema Object is used to hold information about a DA services' schema. The Schema can be accessed through the Global Object's object, by accessing its schema field.

The code snippet below shows how the schema object can be used:

for (i=0; i<schema.dataTables.count; i++)
{
  log('schema.dataTables['+i+'].name ='+schema.dataTables[i].name);
  log('schema.dataTables['+i+'].kind ='+schema.dataTables[i].kind);
  log('schema.dataTables['+i+'].description ='+schema.dataTables[i].description);
  log('schema.dataTables['+i+'].customAttributes ='+schema.dataTables[i].customAttributes);
}

Properties

dataTables

Contains an associative array (accessible by index and name through the indexer) with all the data tables in this schema.

commands

Contains an associative array (accessible by index and name through the indexer) with all the commands in this schema.

relationships

Contains an associative array (accessible by index and name through the indexer) with all the relationships in this schema.

updateRules

Contains an associative array (accessible by index and name through the indexer) with all the update rules in this schema.

version

Returns the schema version (integer number). This can be set from the schema modeler and can be used for version support.

customAttributes

Custom attributes associated with the current schema. This is a string that can be set from the schema modeler and can contain any string you want; the script reads and interprets it through this field.