mcpp index

compat.soci

#include

SOCI — a C++ database access library with one API over many engines

#include <soci/soci.h>
mcpp add compat.soci@4.1.4

Usage

From this repository's own test project — built and run by CI, not written for the website.

// Behavioral test: a real SQLite session driven through SOCI.
//
// SOCI is a thin layer over a backend, so a test that opens no session proves
// almost nothing. Every interesting way this package can be wrong — the backend
// TUs not compiled, the missing upstream git submodule not replaced by the
// compat.sqlite3 edge, the private SOCI_SQLITE3_SOURCE switch mismatched, a
// stale generated soci-config.h — shows up only once a statement runs. So every
// assertion below goes through soci::session against `:memory:`, and four of
// them are chosen to be unfakeable:
//
//   * SOCI_VERSION is asserted EXACTLY: it identifies the pinned upstream
//     release, the same way tests/examples/sqlite3 asserts sqlite3_libversion().
//   * `select sqlite_version()` must return a real SQLite version: the
//     amalgamation can only have come from the compat.sqlite3 dependency, since
//     upstream's own copy is a git submodule the source tarball omits.
//   * the error paths must produce a sqlite3_soci_error carrying the backend's
//     own backend name, error code and error CATEGORY — a real backend raising
//     real errors, not a stub.
//   * NULL round-tripping is asserted through soci::indicator, which is SOCI's
//     own layer (the backend reports the column type, the core maps it).
//
// The backend is reached as a FACTORY OBJECT (soci::sqlite3) rather than through
// …

tests/examples/soci/tests/soci_test.cpp · project tests/examples/soci

Build

targets
soci (lib)
language
c++23
import std
no
include dirs
*/include, */include/private, mcpp_generated/include

Sources (2)

  • */src/core/*.cpp
  • */src/backends/sqlite3/*.cpp

Generated files

  • mcpp_generated/include/mcpp_soci_defines.h
  • mcpp_generated/include/soci/soci-config.h

Versions

VersionPlatforms Mirrorssha256
4.1.4 latest LinuxWindowsmacOS source 144f017cccc2…