mcpp index

compat.sqlitecpp

#include

SQLiteCpp: a smart and easy to use C++ SQLite3 wrapper

#include <SQLiteCpp/SQLiteCpp.h>
mcpp add compat.sqlitecpp@3.3.3

用法

来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。

// Behavioral test: a real database session through the RAII wrapper.
//
// The load-bearing question for this package is whether the dependency edge on
// compat.sqlite3 actually replaces upstream's git submodule — and that is a LINK
// question, so every assertion below is chosen to reach sqlite3 symbols: the
// version string, prepared statements with bound parameters, a transaction that
// rolls back, and the exception path (which carries an sqlite3 error code).
#include <SQLiteCpp/SQLiteCpp.h>

#include <cassert>
#include <string>

int main() {
    // The wrapper reports the SQLite it was linked against, which is the
    // cheapest proof that the dependency edge resolved to a real library.
    const std::string version = SQLite::getLibVersion();
    assert(!version.empty() && version[0] == '3');

    SQLite::Database db(":memory:", SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE);

    db.exec("CREATE TABLE note (id INTEGER PRIMARY KEY, title TEXT NOT NULL, size INTEGER)");
    assert(db.tableExists("note"));
// …

tests/examples/sqlitecpp/tests/database.cpp · 项目 tests/examples/sqlitecpp

构建

targets
SQLiteCpp (lib)
language
c++23
import std
no
include dirs
*/include

源文件 (1)

  • */src/*.cpp

版本

版本平台 镜像sha256
3.3.3 最新 LinuxWindowsmacOS GLOBAL CN 33bd4372d83b…