ORM C++
Loading...
Searching...
No Matches
ORM C++

ORM C++ is a C++20 ORM that maps plain aggregate structs to database tables using compile-time reflection. It ships with SQLite, PostgreSQL, MySQL and MariaDB backends built on SOCI.

Import the ORM with its named module:

import orm;

Link the CMake target orm-cxx::orm-cxx. For standalone compile-time reflection, use the separate module instead:

Link the CMake target orm-cxx::reflection. Both targets are compiled libraries. Include any standard-library headers used by your application in the usual way.

Build requirements: CMake 3.31+, Ninja 1.11+, GCC 15+, Clang 18+, or MSVC 19.50+. Installed packages include module interface sources and native CMake metadata; CMake builds BMIs locally.

Start here

  1. Quickstart: SQLite CRUD — a complete application, build commands and expected output.
  2. Model — aggregate fields, closed schemas, names and keys.
  3. Database — connections, CRUD, errors and transactions.
  4. Query — mutable queries and typed predicates.
  5. Partial-result queries — flat DTOs and aggregates.
  6. Static query plans — reusable immutable query shapes.
  7. Collection relations — mapping, loading and changing links.
  8. Schema migrations — reviewed model changes and SQL.

Integration reference

For contributors and maintainers

API reference

The generated reference covers all four optional adapters; an installed library exports only the adapters selected at build time. Its documentation profile enables every adapter, so values shown for orm::config describe that profile, not the default core-only build.