Skip to content

AnnaDB connection

FelixTheC edited this page Mar 2, 2023 · 1 revision

Create a new AnnaDB instance

#include "connection.hpp"

annadb::AnnaDB con {"jondoe", "passwd1234", "localhost", 10001};

Establish a new connection

#include "connection.hpp"

annadb::AnnaDB con {"jondoe", "passwd1234", "localhost", 10001};

con.connect();

Send a raw query

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|,},];");

Send a query

  • the Query class will be described in a different section in more detail
Query query {"test_journal"};
query.<Query Command>

auto answer = con.send(query);

Close the connection

  • do not forget to close the connection when your done
#include "connection.hpp"

...

con.close();
Clone this wiki locally