forked from blue/lmdbal
42 lines
668 B
C++
42 lines
668 B
C++
#include <iostream>
|
|
|
|
#include "database.h"
|
|
#include "table.h"
|
|
|
|
|
|
template<class T>
|
|
class Serializer {
|
|
public:
|
|
Serializer(const T& value):val(value) {}
|
|
|
|
void print() {
|
|
std::cout << val << std::endl;
|
|
}
|
|
|
|
T val;
|
|
};
|
|
|
|
|
|
template<>
|
|
class Serializer<int> {
|
|
public:
|
|
Serializer(int v): value(v) {}
|
|
|
|
int value;
|
|
};
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
Core::DataBase base("test1");
|
|
Core::DataBase::Table<uint32_t, uint32_t>* table1 = base.addTable<uint32_t, uint32_t>("table1");
|
|
Core::DataBase::Table<QString, QString>* table2 = base.addTable<QString, QString>("table2");
|
|
|
|
base.open();
|
|
|
|
table1->addRecord(1, 2);
|
|
|
|
|
|
|
|
return 0;
|
|
}
|