blob: 5ddcbe9c56265bc65fb2befb303953704dd25312 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include <vector>
#include "../include/Database.hpp"
#include "../include/Group.hpp"
#include "../include/LocalUser.hpp"
using namespace odhtdb;
int main()
{
// TODO: For tests, dont run against bootstrap.ring.cx.
// Run against a bootstrap node made only for testing which doesn't persist added data.
Database database("bootstrap.ring.cx", 4222);
database.seed();
LocalUser *localUser = LocalUser::create("dec05eba");
Group group("admin");
group.addUser(localUser);
database.create("galax.channel.latenight.chat", &group);
const char *data = "hello, world!";
database.add("galax.channel.latenight.chat", DataView{ (void*)data, strlen(data) });
database.commit();
return 0;
}
|