C++
|
Connection options for C++ ArcadeDB exposes multiple wire protocols, so you can pick the one your stack already speaks:
There is no actively maintained Neo4j BOLT driver for C. If you need Cypher from C, the easiest path is to use the HTTP/JSON API or to embed a BOLT-capable runtime (e.g. Python via pybind11). |
PostgreSQL Wire Protocol — libpqxx
#include <pqxx/pqxx>
#include <iostream>
int main() {
pqxx::connection conn(
"host=localhost port=5432 dbname=mydatabase "
"user=root password=playwithdata");
pqxx::work tx{conn};
auto result = tx.exec("SELECT FROM schema:types LIMIT 5");
for (auto const &row : result)
std::cout << row[0].c_str() << "\n";
tx.commit();
return 0;
}
Build:
g++ -std=c++17 example.cpp -lpqxx -lpq -o example
HTTP/JSON API — cpp-httplib
#include <httplib.h>
#include <iostream>
int main() {
httplib::Client cli("http://localhost:2480");
cli.set_basic_auth("root", "playwithdata");
auto res = cli.Post(
"/api/v1/query/mydatabase",
R"({"language":"sql","command":"SELECT FROM schema:types LIMIT 5"})",
"application/json");
if (res) std::cout << res->body << "\n";
return 0;
}
Build (header-only library):
g++ -std=c++17 example.cpp -o example