Skip to main content

C++ Business Scenarios

The shared query contract and data operations concepts explain the common vocabulary. C++ syntax, ownership and verification remain scoped to the generated guides and C++ evidence below.

Begin with the SQLite console, then change one business operation at a time. The generated cpp_lib_core/assist/ directory provides native workflows for the evaluated tenant/document/entry model. Use those files to discover methods; do not search the generated implementation.

Reader taskStart withWhat to verify
Load one tenant or a bounded listassist/tenant/query.mdBind Q to the executing UserContext; supply non-empty comment and purpose; inspect the typed result before Context close.
Change a tenant's nameassist/tenant/write.md, then assist/tenant/fields/name.mdLoad complete scalar state, use the emitted mutation API and attach a non-empty audit reason.
Read selected fieldsassist/tenant/expression.mdDistinguish a loaded value, explicit NULL and NotLoaded; getters do not run SQL.
Load documents or entriesThe entity's Query guide and the selected relationship's field guideSelect relationships explicitly and use bounded child queries; keep composed requests in compatible Contexts.
Page a business listassist/tenant/list_page.mdStable ordering, bounded page size and the emitted page/result carrier.
Consume scalar rows incrementallyassist/tenant/stream.mdComplete or close the stream before its Context closes; scalar streaming does not enhance relationships or aggregates.
Add grouped statistics or facetscpp_lib_core/ASSIST.md and relevant field guidesDiscover the model-specific projection and aggregate names; compare full filtered totals with the actual rows.

The Data Operations page explains the starter's read and audited-update helpers. The retained graph example adds twelve graph scenarios with assertions on callbacks, audit and database rows. Its test suite is separate from the public starter smoke test.

Keep the execution boundary visible​

Use user_context for generated execution. Tenant, actor, provider and authorization policy come from trusted application assembly. A client filter or a decoded entity does not supply those permissions. Read authoritative state before updating an existing object.

For several writes that must commit together, follow the generated Write and runtime customization guides for transaction-owned operations. Ordinary Q execution through the surrounding UserContext does not automatically join an outer transaction. An audit-delivery error after commit means the database write committed; handle delivery recovery separately from write retry.

These are C++/SQLite workflows. The existing seven-language Order isolation, pagination and lifecycle receipts do not qualify a C++ Order implementation. Record new evidence for the actual model and operation you ship.