Archetype: sql_dataset_refdata.mustache
Dataset row for one FPML coding scheme ({{dataset}} with optional publication_date), emitted per scheme by the FPML import.
See the Template variable reference for the complete list of available variables and their semantics.
Template
The full template source. Edit here and re-tangle with
compass build --direct tangle_codegen_templates to regenerate
library/templates/sql_dataset_refdata.mustache.
{{! GENERATED FILE — tangled from projects/ores.codegen/library/templates/sql_populate.org. Edit the org source. }}
{{! Template to generate SQL dataset entry for FPML reference data }}
{{{sql_license}}}
/**
* AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
* Template: sql_dataset_refdata.mustache
* To modify, update the template and regenerate.
*
* {{dataset.name}} Dataset Population Script
*
* Creates the dataset entry for {{dataset.code}}.
* Source version: {{dataset.source_version}}
* This must be run before populating the artefact table.
*/
-- =============================================================================
-- {{dataset.name}} Dataset
-- =============================================================================
\echo '--- {{dataset.name}} Dataset ---'
select ores_dq_datasets_upsert_fn(ores_utility_system_tenant_id_fn(),
'{{dataset.code}}',
'FpML Standards',
'{{entity.subject_area}}',
'Reference Data',
'{{dataset.coding_scheme_code}}',
'Primary',
'Actual',
'Raw',
'FpML Genericode Download',
'{{dataset.name}}',
'{{dataset.description}}',
'FPML',
'Reference data for {{dataset.name}} (version {{dataset.source_version}})',
{{#dataset.publication_date}}'{{dataset.publication_date}}'::date{{/dataset.publication_date}}{{^dataset.publication_date}}current_date{{/dataset.publication_date}},
'FpML Public License 2.0',
{{#shared_table_config}}'{{shared_table_config.artefact_type}}'{{/shared_table_config}}{{^shared_table_config}}'{{entity.entity_plural}}'{{/shared_table_config}}
);
See also
- Parent facet: SQL populate templates
- Template variable reference