Databases

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Databases

Framework supports simultaneous access to any number of databases of any type.

 

Database can be registered using the following method:

 

TWebUIServer.RegisterDatabase(const Name: string; Pool: TDMProviderPool); 

 

By default there are three databases:

default - main database

ui - database where UI tables are stored

server - virtual database with server data (sessions, statistics, etc.).

 

UI is stored in a seven tables:

 

UI_CLASSES - classes

UI_FRAMES - frames

UI_FRAMES_HISTORY - history of UI frames

UI_ACTIONS - actions

UI_CLASS_ACCESS - access righs

UI_DICTIONARIES - dictionaries

UI_OPERATIONS - operations

 

These tables may be stored in main DB or separate DB, f.e local SQLite database.

 

/sql folder contains SQL scripts for creating UI tables in different databases. Script can be executed by callin TWebUIBuilder.CreateTables method.

 

TWebUIServer contains two pools for database access:

 

Pool: TDMProviderPool - main database

UIPool: TDMProviderPool - UI database.

 

Request object contains two properties for performing database queries:

 

Provider: TDMProvider - main database

UIProvider - UI database

 

When UI is stored in a main database, these pools and providers may be the same.

 

Access to database is performed using abstract DM (DataModel) layer from HTML SQL Framework. There are adapters for several access components:

FireDAC - DMFireDAC unit.

UniDAC - DMUniDAC unit.

UIB - DMUIB unit.