mcpp index

compat.sqlite3

#include

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

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

用法

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

// 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 · 项目 tests/examples/sqlite3

构建

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

源文件 (1)

  • */sqlite3.c

版本

版本平台 镜像sha256
3.45.3 最新 LinuxWindowsmacOS 源站 ea170e73e447…