This is a C++ driver built for type-safe query creation.
AnnaDB uses a custom query language called TySON
- zeromq
- cmake >= 3.24
- googletest
- generated via
doxygen
under docs
- create a AnnaDB instance via
docker-compose up
access the DB via port10001
onlocalhost
- the major and minor version will match with these from AnnaDB
- if AnnaDB has a Version like 1.3 then you should use the latest driver version between >= 1.3.0 and < 1.4.0 as patch versions will not match
#include "connection.hpp"
annadb::AnnaDB con {"jondoe", "passwd1234", "localhost", 10001};
con.connect();
// do something
con.close();
- AnnaDB QueryCmd Documentation
- the result of a query request is a
std::optional<annadb::Journal>
#include "connection.hpp"
// ...
auto answer = con.send("collection|test_journal|:insert[s|foo|,"
"n|100|,"
"b|true|,"
"v[n|1|,n|2|,n|3|,],"
"m{s|bar|:s|baz|,},"
"];");
// ...
- the
annadb::Journal
class
// ...
// you need to check, cause Journal is an optional
if (answer)
{
// annadb::Journal contains two members to get information from the query
// the data and the meta information
const auto data_information = answer.value().data();
const auto meta_information = answer.value().meta();
}
// ...