OpenSCADAWiki: Home Page En/Doc/API/part3
 

3. Subsystem "Database" (TBDS)

Subsystem "Databases" is represented by the object TBDS, which contains a modular objects of the following types of DB TTypeBD. Each type of database contains objects of individual databases of that type TBD. Each database in its turn, contains the objects of their tables TTable (Fig. 3).

Hierarchical structure of the database subsystem. (37 Kb)
Fig. 3. Hierarchical structure of the database subsystem.


The subsystem provides the basic functions to access the type of database, as well as generalized functions for the manipulation of the databases and tables. For example, to hide the source of data, which may be a configuration file, the functions of an abstract access to the data source are provided. For the storage system-wide data the system table and the function of the abstract to access it are provided. Consequently, system-wide data can be stored in the configuration file and in the database table. Priority source, in this case, is the database table.

Being a modular object, the type of database (TTypeBD) provides access to the implementation of the mechanism of one or another database. Access is made through a public databases of the module of a given type of database. Open/registered database is described in the table of databases to be opened or in the configuration file. There is, the so-called, the working database, which is always opens and is shown in the configuration file. DB which support the SQL-queries can grant access based on direct SQL-queries.

While working, the components of the OpenSCADA system open tables (TTable) available in the database and work with them.

3.1. Object of subsystem "Database" (TBDS)

Inherits:TSubSYS, TElem.

Data:
Flags of the queries to the system table (enum – TDBS::ReqGen):

Public methods:

3.2. Modular object of types of databases (TTypeBD)

Inherits:TModule.
Inherited:By root objects of the modules of subsystem "DB".

Public methods:

3.3. The object of the database (TBD)

Inherits:TCntrNode, TConfig.
Inherited:By the database objects of the modules of subsystem "DB".

Public methods:

Protected methods:

3.4. The object of the table (TTable)

Inherits:TCntrNode.
Inherited:By tables objects of the modules of subsystem "DB".

Public methods: