C++ Customization
Keep application behavior in cpp_app_console/. Models, generated metadata,
Q/E adapters and domain implementation remain owned by generation. Start
from the Quick Start and read
cpp_lib_core/assist/runtime/runtime_custom.md before changing assembly.
One-time application setup
Own GlobalContext at application scope and create each unit of work's
UserContext through it. Register trusted provider, actor, tenant and policy
services before business execution. Allocate managed objects through the
intended Context and register native resources with its resource lifecycle.
Complete outstanding asynchronous work before reclaiming referenced memory.
The sample's generated setup configures runtime services and explicitly
ensures schema; its default database is :memory:. The separate
configureRuntime entry installs runtime defaults without creating schema.
For custom assembly, configure first, install application Checker/Behavior
overrides, apply the module and then explicitly ensure schema. Calling setup
or configuration again replaces those registrations with defaults. Follow
assist/runtime/schema.md for the exact sequence.
Extend the business rules
| Extension | Application responsibility |
|---|---|
| Checker/Fix | Implement the model-specific hooks from Assist. Keep automatic repair separate from read-only validation and preserve structured findings. |
| Behavior | Register application-owned service hooks with a declared Context lifetime. |
| Actor-derived fields | Install the trusted Context fix resolver used by the model's configured functions before executing writes. |
| Authorization | Install and test application policy; typed APIs and audit reasons do not define tenant or actor permissions by themselves. |
| Audit delivery | Configure the application sink and recovery path. Delivery after commit is distinct from database transaction success. |
| Locale/catalog | Use the generated i18n guide to load and install catalogs explicitly; keep parsed values within their declared Context lifetime. |
Do not guess generated class, field or registration names. Request the entity's Write workflow and the specific field/runtime guide, then use compiler diagnostics to validate the implementation.
Select the runtime deliberately
For the published consumer, use the Quick Start's Conan installation and
TEAQL_RUNTIME_MODE=release. Release mode requires the exact installed
teaql_cpp 0.2.0 package and rejects a non-empty TEAQL_RUNTIME_SOURCE.
Runtime development can explicitly select TEAQL_RUNTIME_MODE=workspace
with an absolute TEAQL_RUNTIME_SOURCE pointing to an identifiable Git
checkout. The generated CMake helper records commit and dirty state in
runtime_selection.json. A workspace result must be labeled as such; it does
not establish a published-package pass.
After model changes, regenerate only cpp-lib-core, restore/check markers and
rerun the affected application tests. See First Verification
for evidence and Debugging for recovery.