ores.cpp.repository
Table of Contents
This page is the node for the ores.cpp.repository facet of the codegen
template library, part of the ores.cpp 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
Six templates — three hpp/cpp pairs — forming the entity's persistence
triplet: the sqlgen entity struct mirroring the table, the mapper
converting domain ↔ entity, and the repository exposing CRUD and
temporal queries. repository profile.
The ores.cpp.repository facet
The persistence layer of the entity projection: the database
round-trip entity ↔ mapper ↔ repository over sqlgen. Declarations in
.hpp, out-of-class implementations in .cpp, with custom-method
paste points from the entity org-model where the generated default is
not enough.
Mustache incantations
Column loops dispatch on per-field type flags (is_string,
is_boolean, is_timestamp, …) to choose C++ types and defaults;
{{^last}} drives comma placement. Custom-method injection points
reference the org entity meta-model's paste markers. Otherwise the
group's standard constructs.
Archetypes
| Archetype | Description |
|---|---|
| ores.cpp.repository.entity_header | sqlgen-side struct mirroring the table shape. repository profile. |
| ores.cpp.repository.entity_impl | Out-of-class implementations for the sqlgen entity. repository profile. |
| ores.cpp.repository.mapper_header | Mapper declarations. repository profile. |
| ores.cpp.repository.mapper_impl | Domain ↔ entity conversions including timestamp handling. repository profile. |
| ores.cpp.repository.repository_header | Repository declarations with custom-member paste points. repository profile. |
| ores.cpp.repository.repository_impl | CRUD + temporal queries over sqlgen; custom-method paste points. repository profile. |
See also
- ores.cpp — the parent technical space's generated facet/archetype catalogue and shared Mustache conventions.
- C++ Technical Space — the domain-concept overview of this technical space.
- Codegen template library — the groups overview.