Skip to main content

C++ Quick Start

Start with a tenant, its documents and their entries. The console prepares an in-memory SQLite database, creates the modeled root through audited bootstrap, then reads a bounded tenant list. This is the example used in the C++ announcement.

The commands below describe the released Linux workflow. Model evaluation, public generation and workspace markers were checked again on 2026-12-03; native compilation and execution were not rerun on the documentation host. See First Verification for the existing run evidence and the local blocker.

Prepare the tools and model​

Use Linux x86_64 with Conan 2.35.0 and the TeaQL C++ 0.2.0 native toolchain: Clang 23.1.3, GCC/libstdc++ 16.2.0, CMake 4.4.4 and Ninja 1.13.2. Activate that toolchain in Bash before configuring the consumer. Conan fetches SQLite 3.53.2 transitively; no database server is needed.

For model evaluation, install the client described in Prepare the Client. In a new directory, download the pinned model and evaluate it:

mkdir teaql-cpp-console
cd teaql-cpp-console
mkdir models
curl -fsSL -H 'Accept: application/vnd.github.raw+json' \
'https://api.github.com/repos/teaql/teaql-cpp/contents/examples/graph_save_console/models/main.xml?ref=d0730d124d4f3a0970e137df7eea25c63730c033' \
-o models/main.xml
cargo teaql evaluate --endpoint-prefix https://api.teaql.io/latest/ --input models/

Read the complete evaluation report and resolve model errors before generation. The model declares namespace cpp_graph_save and SQLite. Its document and entry fields also demonstrate model validation and trusted actor-derived values. The pinned release fixture evaluates with 0 errors and 11 warnings about display metadata, naming and generic example values. Those warnings are accepted here to preserve the release fixture's identity; improve that metadata in a new application's model rather than treating this as a warning-free example.

Generate the editable workspace​

The public HTTP target accepts the same model:

curl -fsSLo console.zip -H 'Content-Type: application/xml' \
--data-binary @models/main.xml https://api.teaql.io/latest/cpp-app-console
unzip -q console.zip -d console
cd console
python3 tools/context_markers.py --check

Read AGENTS.md, cpp_app_console/AGENTS.md and cpp_lib_core/ASSIST.md. The layout is:

PathResponsibility
cpp_app_console/src/main.cppApplication entry, GlobalContext and UserContext
cpp_app_console/src/business.hppEditable bounded read, E access and audited-update helpers
cpp_app_console/tests/smoke.cppApplication smoke test
cpp_lib_core/assist/Model-aware API guidance
cpp_lib_core/lib/Regenerable domain implementation; keep it unchanged
conanfile.txt, profiles/, cmake/teaql_runtime.cmakeDependencies, ABI profile and explicit runtime selection

Install, build and run​

Use a project-owned Conan cache for this first isolated consumer:

export CONAN_HOME="$PWD/.conan-teaql"
conan remote add teaql https://nexus.teaql.io/repository/conan-hosted/conan
conan install . -r teaql --build=never \
-pr:h profiles/linux-x86_64-clang23-debug \
-pr:b profiles/linux-x86_64-clang23-debug -of build/conan
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=conan/conan_toolchain.cmake \
-DCMAKE_BUILD_TYPE=Debug -DTEAQL_RUNTIME_MODE=release
cmake --build build --parallel 3
ctest --test-dir build --output-on-failure --no-tests=error
./build/cpp_app_console/teaql_console

--build=never requires a matching published binary instead of silently building a substitute. If authentication is required, use conan remote login teaql USERNAME and enter the registry token at its prompt. The generated runtime requirement is exactly teaql-cpp/0.2.0.

The recorded console run printed these lines after the audit log:

1
Loaded 1 entities

Each launch uses a new in-memory database. This output proves the starter's bootstrap and bounded read, not persistence across process restarts or an application authorization policy.

Make the first application change​

Use the Data Operations guide to read and update through business.hpp. Request entity/action Assist first, then only the fields involved. Compile and run the application after each change.

Generate cpp-app-console once. After a model change, evaluate again and regenerate only cpp-lib-core into the existing cpp_lib_core/ directory:

cargo teaql cpp-lib-core --endpoint-prefix https://api.teaql.io/latest/ \
--input ../models/ --output cpp_lib_core
python3 tools/context_markers.py --restore
python3 tools/context_markers.py --check
cmake --build build --parallel 3
ctest --test-dir build --output-on-failure --no-tests=error

Keep the model and editable application code. Once a disposable verification workspace has finished and all its processes have exited, its build output, downloaded archive and project-owned Conan cache can be removed; retain compact versions, commands and test results. Do not remove a shared Conan cache.