compat.mysql-connector-cpp
#includeMySQL Connector/C++ X DevAPI and JDBC (static, source-built)
#include <mysql/jdbc.h>
mcpp add compat.mysql-connector-cpp@26.7.0
Usage
From this repository's own test project — built and run by CI, not written for the website.
#ifdef HAVE_MYSQL_CONNECTOR_CPP
#include <mysqlx/xdevapi.h>
#include <mysql/jdbc.h>
#include <string>
int main() {
// 同一个 Connector/C++ 包应同时提供 X DevAPI 和 JDBC。
mysqlx::Value value(std::string("mcpp"));
if (value.get<std::string>() != "mcpp") return 1;
sql::mysql::MySQL_Driver* driver = sql::mysql::get_mysql_driver_instance();
if (driver == nullptr) return 2;
if (driver->getMajorVersion() != 26) return 3;
if (driver->getMinorVersion() != 7) return 4;
return driver->getPatchVersion() == 0 ? 0 : 5;
}
#else
int main() { return 0; }
#endif
tests/examples/mysql-connector-cpp/tests/connector.cpp · project tests/examples/mysql-connector-cpp
Build
- targets
mysql_connector_cpp (lib)- language
c++23- import std
- no
- include dirs
include
Sources (1)
mcpp_mysql_connector_cpp_anchor.c
Versions
| Version | Platforms | Mirrors | sha256 |
|---|---|---|---|
26.7.0 latest |
LinuxmacOS | source | b2299862eefc… |