Configuration file¶
The model generation part of the SQL composer requires some additional information (e.g. source of metadata, list of objects, ...). This information is passed on to the program via a configuration YAML file.
YAML schema¶
General structure¶
metadata: <source_of_metadata> # (1)!
system: <target_system> # (2)!
<global_parameters>: ... # (3)!
<cust-group-1>: # (4)!
<group_parameters>: ... # (5)!
objects:
- name: <object_name>
<object_parameters>: ... # (6)!
- name: <object_name>
- name: <object_name>
<cust-group-2>:
<group_parameters>: ...
objects:
- name: <object_name>
<object_parameters>: ...
- Detailed description on supported metadata sources can be found here.
- Platform for which to create models.
- Additional global parameters, e.g. object_type.
- YAML can be divided into custom groups. This is optional, if only a single group is required no group needs to be specified.
- Group parameters provide additional information for the objects in that particular group. They overwrite global parameters. E.g. set schema name for all tables listed in that group.
- Object parameters overwrite global and group parameters for a specific object.
Each configuration file must contain the following parameters:
Mandatory parameters¶
There is a minimal set of information that must be provided by the configuration file. The configuration file must include: - information on source of metadata - target system - list of objects
A minimal configuration file could look like the following:
metadata: <metadata_source>
system: <target_system>
object_type: <object_type>
objects:
- name: <object_name>
Metadata¶
- Provides information on the source of metadata. This parameter can only be set in the global scope. Detailed information can be found here.
- system
- Target platform for which to create the YAML metadata models. This parameter can only be set in the global scope. Currently only snowflake is supported.
- object_type
- Define the object type for which to create the model. Supported types: table, procedure
| Target system | Object type | Description |
|---|---|---|
| snowflake | table | Table DDL. Standard template will include technical columns, such as BK, _DCR, _DMR. |
| snowflake | procedure | Create statement of a Snowflake stored procedure. Procedure will perform a truncate followed by an insert statement. |
- objects
- List of objects for which to retrieve the metadata and create the models. Object names must be found in the metadata source.
Additional parameters¶
Depending on the target system and object type there are additional parameters that can be set.
Object type: table¶
object_type: "table"
schema: <schema_name>
prefix: <table_prefix> # (1)!
objects:
- name: <table_name>
- name: ...
- default: TBL
Provide additional information on the database schema and a prefix added to the table name.
Object type: procedure¶
object_type: "procedure"
schema: <schema_name>
prefix: <table_prefix> # (1)!
source:
name: <source_table>
schema: <source_schema>
prefix: <table_prefix> # optional
target: # optional
name: <target_table>
schema: <target_schema>
prefix: <table_prefix>
objects:
- name: <table_name>
- name: ...
- default: SP
Provide information on the database schema and a used prefix for the procedure itself. Also provide the necessary information for the source and target table of the insert statement in the procedure.