Repository Structure
At the root of the repository, the following directories and files are used:
datasources/
virtual_schemas/
jobs/
optimizations/
users/
roles/
queue_handlers/
data-catalog.sql
web-business-data-shop.sql
options.sql
Data Sources
Each data source is stored in the datasources/ folder.
Basic structure
datasources/
├── <data-source-1-name>.sql
├── <data-source-2-name>.sql
└── remarks.sql
Data Source Definition
<data-source-name>.sql contains the main SQL script with the data source definition. The file name is equal to the data source name.
Remarks
If remarks exist for a data source or a system schema, a remarks.sql file is created. All remarks for data sources and system schemas are stored in this file.
The exception is when the data source has foreign functions - see the section describing foreign functions below.
Foreign Functions
If there are foreign functions for a data source, a sub-folder with the data source's name is created inside the virtual_schemas/ folder, and a functions/ folder is created inside it. Each foreign function is represented by its own SQL file inside the functions/ folder, and the file name is equal to the function name.
If remarks exist for this data source or object it contains, a sub-folder is created within virtual_schemas/<data-source-name>. The name of this sub-folder corresponds to the type of object for which the remark was created. All remarks are stored in one SQL file inside a folder named after the objects to which these remarks belong, that is, procedures/ for data source procedures or views/ for tables and views.
The file contains SQL statements that set the remarks for the corresponding objects.
Virtual Schemas
Each virtual schema has its own sub-folder in virtual_views/. Folder name matches the schema name.
Basic Structure
virtual_schemas/
├── <virtual-schema-1-name>
│ ├── views
│ ├── procedures
│ └── create.sql
└── <data-source-with-foreing-function-name>
├── functions
│ └── <function-name>.sql
├── procedures
│ └── remarks.sql
└── views
└── remarks.sql
Virtual Schema/Schema Definition
create.sql contains the main SQL script with the schema definition.
Views
The view/ folder contains files with view definitions, each view is stored separately. The file name corresponds to the view name.
Procedures
The procedure/ folder contains files with procedure definitions, each procedure is stored separately. The file name corresponds to the procedure name.
Jobs
The jobs/ directory contains definitions of all jobs in the system.
Basic Structure
jobs/
└── <job-UUID>/
├── <job-UUID>.sql
└── schedules/
├── <schedule-1-UUID>.sql
├── <schedule-2-UUID>.sql
└── <schedule-n-UUID>.sql
Job Definitions
Each job has its own sub-folder in jobs/, and this folder is named after the job UUID. Inside that folder, the file <job-UUID>.sql file contains the job creation script together with its properties.
The following properties are stored in the same file as the job creation script:
job owner
job executor
job
enabledflagparallelRunsAllowed
Schedules
If a job has schedules, a schedules/ sub-folder is created inside the job folder. Every schedule is stored as a separate SQL file in this sub-folder, and each file name is equal to the schedule UUID, for example, <schedule-UUID>.sql.
Optimizations
The optimizations/ directory contains recommended optimizations, their materialized tables, indexes, and symbols.
Basic Structure
optimizations/
├── rec_opt_symbols.sql
└── <optimization-name>/
├── <optimization-name>.sql
└── indexes/
├── <index-1>.sql
├── <index-2>.sql
└── <index-n>.sql
Recommended Optimizations
Each recommended optimization is stored in its own sub-folder under optimizations/. The name of this sub-folder is the match descriptor value, which also serves as the optimization name. Inside this folder, the main SQL file <optimization-name>.sql contains the optimization definition.
The setRecOptAllowIndexCreationByStatus procedure call is included in the same file as the optimization.
Only the optimisations that meet one of the criteria are stored in the repository:
enabled;
have been materialized at least once;
an optimization job was created for it.
Materialized Tables
Each materialized table is stored in the same SQL file as the recommended optimization for which it was created. Only materialized tables whose status is READY are persisted in the repository.
Indexes
Indexes related to a particular optimization are stored in the indexes/ sub-folder inside that optimization’s folder. Each recommended index is represented by a separate SQL file in this directory. Only indexes with status ACCEPTED are stored in the repository, each file name is equal to the index UUID.
rec_opt_symbols.sql
rec_opt_symbols.sql is a single file at the root of optimizations/. It contains definitions of rec_opt_symbols.
Users
The users/ directory contains user definitions together with their role assignments.
Basic Structure
users/
└── <username>/
├── <username>.sql
└── roles/
├── <role-1-name>.sql
├── <role-2-name>.sql
└── <role-n-name>.sql
User Definition
Each user has their own sub-folder in users/, and the folder name is equal to the username. Inside this folder, the <username>.sql file contains the user definition.
Role Assignments
Role assignments for a user are stored in the roles/ sub-folder inside that user’s folder. Each assignment is represented by a separate SQL file whose name equals the role name.
Roles
The roles/ directory contains definitions of roles and their permissions on resources.
Basic Structure
roles/
└── <role-name>/
├── permissions/
│ ├── <permission-1>.sql
│ ├── <permission-2>.sql
│ └── <permission-n>.sql
└── <role-name>.sql
Role Definitions
Each role is represented by a separate folder whose name equals the role name. Inside this folder, the <role-name>.sql file contains the role definition script.
Permissions
Permissions for a role are stored in the permissions/ sub-folder of that role’s folder. Each resource on which the role has permissions is described by a separate SQL file.
File names follow one of two formats:
resource_nameresource_type.resource_namewhen the resource type is explicitly set.
Queue Handlers
The queue_handlers/ directory contains creation scripts for queue handlers. Each queue handler is represented by an individual SQL file whose name is equal to the queue handler name.
The new repository structure is available since v25.4