Archetype: sql_dataset_dependency_populate.mustache

Table of Contents

Parent/child links between datasets ({{#dataset_dependencies}}: parent code, dependency code, role) so consumers can order loads.

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_dependency_populate.mustache.

{{! GENERATED FILE — tangled from projects/ores.codegen/library/templates/sql_populate.org. Edit the org source. }}
{{! Template to generate SQL with enhanced GPL v3 license and dataset dependency data }}
{{{sql_license}}}
/*
 * AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
 * Template: sql_dataset_dependency_populate.mustache
 * To modify, update the template and regenerate.
 */

-- =============================================================================
-- Data Quality Slovaris Dataset Dependencies
-- =============================================================================

\echo '--- Data Quality Slovaris Dataset Dependencies ---'

{{#datasets}}
{{#dataset_dependencies}}
select ores_dq_dataset_dependencies_upsert_fn(ores_utility_system_tenant_id_fn(),
    '{{parent_code}}',
    '{{dependency_code}}',
    '{{role}}'
);
{{/dataset_dependencies}}
{{/datasets}}

-- =============================================================================
-- Summary
-- =============================================================================

\echo ''
\echo '--- Summary ---'

select dataset_code, dependency_code, role
from ores_dq_dataset_dependencies_tbl
where valid_to = ores_utility_infinity_timestamp_fn()
  and dataset_code like 'slovaris.%'
order by dataset_code, dependency_code;

See also

Emacs 29.1 (Org mode 9.6.6)