1
0
forked from blue/lmdbal
lmdbal/main.cpp

42 lines
668 B
C++
Raw Normal View History

2022-09-04 10:14:42 +00:00
#include <iostream>
2022-09-09 17:15:40 +00:00
#include "database.h"
#include "table.h"
2022-09-04 11:15:31 +00:00
2022-09-12 15:16:18 +00:00
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;
};
2022-09-04 10:14:42 +00:00
int main(int argc, char **argv) {
2022-09-09 17:15:40 +00:00
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);
2022-09-12 15:16:18 +00:00
2022-09-04 10:14:42 +00:00
return 0;
}