ores.sql.populate

Table of Contents

This page is the node for the ores.sql.populate facet of the codegen template library, part of the ores.sql technical space. Each archetype below is documented, and holds its mustache source, in its own linked page — this page is the facet-level summary and the routing table to them.

Summary

Reference-data INSERT templates: dataset and catalog registration, ISO and non-ISO currencies, countries, flag SVGs, methodologies, tags, the FPML refdata artefact/function pair, and the batch-execute master include. None belongs to a profile — all are invoked directly by generator.py's dataset pipeline (the slovaris dataset and FPML reference data now owned by ores.seeder).

The ores.sql.populate facet

The data projection: where ores.sql.schema renders an entity's shape, these templates render its contents — typed datasets (ISO 4217, ISO 3166, FPML coding schemes, …) traced back to their source via dataset rows, dependency links, catalogs and methodologies. The recurring pattern is one INSERT block per item inside a dataset section, each row carrying the dataset code for provenance.

Mustache incantations

Several templates predate the standard header and open with their own {{! purpose }} comment plus an AUTO-GENERATED SQL banner — both preserved verbatim. FPML templates branch on optional fields with {{#field}}/{{^field}} pairs (e.g. publication_date, description); the flag-populate template inlines whole SVG documents via {{generated_svg}}. Otherwise the group's standard constructs.

Archetypes

Archetype Description
ores.sql.populate.batch_execute Master include for a dataset: \ir every generated file in dependency order ({{#model.files}}), with \echo progress markers. The original file had no trailing newline; tangling added one (render-neutral, verified).
ores.sql.populate.catalog Registers data catalogs ({{#catalogs}}: name, owner, description).
ores.sql.populate.country ISO 3166 countries from the country_currency dataset rows: code, numeric, name, official name, traced to {{countries_dataset.name}}.
ores.sql.populate.currency ISO 4217 currencies joined to their countries ({{#country_currency}}), with monetary_nature and lower-cased country code for flag linkage.
ores.sql.populate.dataset Registers the datasets themselves ({{#datasets}}: code, name, catalog, coding scheme, asset type, business context) — the provenance rows every other populate references.
ores.sql.populate.dataset_dependency Parent/child links between datasets ({{#dataset_dependencies}}: parent code, dependency code, role) so consumers can order loads.
ores.sql.populate.flag Country flag SVGs as image rows: {{generated_svg}} inlines the document per country_currency row, keyed by lower-cased country code.
ores.sql.populate.methodology Dataset methodologies ({{#methodologies}}: name, description, steps, url) documenting how each dataset was produced.
ores.sql.populate.tag Classification tags (domain, subject area, name, description) per dataset.

See also

Emacs 29.3 (Org mode 9.6.15)