47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
/**
|
|
* @file unit_test.cc
|
|
* @brief
|
|
* @author Cat (null.null.null@qq.com)
|
|
* @version 0.1
|
|
* @date 2021-05-14
|
|
*
|
|
* Copyright: Baosight Co. Ltd.
|
|
* DO NOT COPY/USE WITHOUT PERMISSION
|
|
*
|
|
* @ChangeLog:
|
|
*/
|
|
#include "mix_cc/sql.h"
|
|
#include "mix_cc/sql/make_table.h"
|
|
#include "mix_cc/sql/database/db2_t.h"
|
|
#include <iostream>
|
|
|
|
using namespace std::chrono;
|
|
using namespace mix_cc::sql;
|
|
|
|
MIX_CC_SQL_MAKE_TABLE(T_RULE_SAMPLE_1D_COMPRESSED, (std::string, rule_id),
|
|
(mix_cc::mix_time_t, last_update), (double, x1),
|
|
(double, prec), (int, flag), (int64_t, count));
|
|
|
|
int main() {
|
|
try {
|
|
T_RULE_SAMPLE_1D_COMPRESSED sample_c;
|
|
auto i = 3;
|
|
std::move(i);
|
|
std::vector<int> test;
|
|
test.emplace_back();
|
|
|
|
auto list =
|
|
exec<db2_t>(select(sample_c.x1(), sample_c.prec(),
|
|
sample_c.count(), sample_c.rule_id())
|
|
.from(sample_c)
|
|
.where(sample_c.flag() == 1));
|
|
for (auto x : list) {
|
|
std::cout << x.rule_id << " " << x.x1 << " " << x.prec << std::endl;
|
|
}
|
|
} catch (const std::exception& e) {
|
|
std::cerr << mix_cc::get_nested_exception(e) << '\n';
|
|
}
|
|
|
|
return 0;
|
|
}
|