SQL template group
Table of Contents
This page documents the sql group of the codegen template
library — the namespace that gathers related facets. Each facet is a
literate org document in this directory whose mustache blocks tangle
to the .mustache artefacts consumed by generator.py; this page
explains what the group's facets have in common and indexes them.
Summary
The SQL projection of the system: DDL for entity and junction
tables (sql_schema), IAM artefacts from the service registry
(sql_service), and reference-data INSERTs (sql_populate).
Schema and service templates are profile-driven (sql,
non-temporal-sql, service-registry) with outputs under
projects/ores.sql/; the populate family is invoked directly by
generator.py's dataset pipeline.
Facets
The table below is generated — run
projects/ores.codegen/scripts/regenerate_facet_inventories.py after
adding or changing facet docs; do not edit it by hand.
| Facet | Templates | Description |
|---|---|---|
| SQL populate templates | 0 | Reference-data INSERT scripts driven directly by generator.py: datasets, catalogs, currencies, countries, flags, tags, methodologies and the batch-execute wrapper. |
| SQL schema templates | 0 | DDL artefacts: entity and junction table creation with temporal/non-temporal variants, drop scripts, notify triggers, and the artefact-tracking table. |
| SQL service registry templates | 0 | IAM artefacts generated from the service registry: service user creation, database grants, service accounts and account-role populates. |
Shared conventions
{{{sql_license}}}triple-stache injects the SQL licence header verbatim; many templates also keep a pre-literate{{! purpose }}comment and anAUTO-GENERATEDSQL banner.- Column/list loops use
{{^last}},{{/last}}inverted sections for comma placement. - File naming follows
{component}_{entity_plural}_<verb>.sqlunderprojects/ores.sql/create|drop|populate/.
See also
- Codegen template library — the groups overview.
- MASD — the methodology these templates instantiate.
- Applied MASD — the facet catalogue and codegen routes.
- facet_catalogue.org — profile → template/output mapping.