mcpp index

compat.sqlite3

#include

SQLite — self-contained SQL database engine (C amalgamation)

#include <sqlite3.h>
mcpp add compat.sqlite3@3.45.3

Usage

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

// Behavioral test for compat.sqlite3 (SQLite 3.45.3, C API): assert the
// resolved library version, then open an in-memory database, create a table,
// insert a row, and read it back through both sqlite3_exec and a prepared
// statement.
#include <sqlite3.h>
#include <cassert>
#include <cstring>

int main() {
    // The index pins 3.45.3; prove the resolved package is that version.
    assert(std::strcmp(sqlite3_libversion(), "3.45.3") == 0);

    sqlite3* db = nullptr;
    assert(sqlite3_open(":memory:", &db) == SQLITE_OK);
    assert(db != nullptr);

    // DDL + DML through the convenience API.
    char* errmsg = nullptr;
    int rc = sqlite3_exec(db,
        "CREATE TABLE t(id INTEGER PRIMARY KEY, name TEXT NOT NULL);"
        "INSERT INTO t(name) VALUES ('mcpp');",
        nullptr, nullptr, &errmsg);
// …

tests/examples/sqlite3/tests/sqlite3_test.cpp · project tests/examples/sqlite3

openkal

targetresultenvironmenttest projectfirst diagnostic
x86_64-linux-gnurunsposixsqlite3
x86_64-windows-muslrunsposixsqlite3

How this was measured

Measured 2026-09-23 by tests/openkal/compat.py with openkal-llvm-runtime 0.15.1, llvm@22.1.8, mcpp 2026.9.21.3. The test project selects no platform dependency of its own. The badge above is a summary of the strictest measured target -- the table above states each target's own environment.

Build

targets
sqlite3 (lib)
language
c++23
C standard
c11
import std
no
include dirs
*

Sources (1)

  • */sqlite3.c

Versions

VersionPlatforms Mirrorssha256
3.45.3 latest LinuxWindowsmacOS source ea170e73e447…