问题描述
我得到一个 std::vector 并想使用 pqxx::stream_to(相当大量的数据)将其流式传输到数据库,例如:
class Controller < T > {
@PostMapping("/save")
ResponseEntity < Response > save(@RequestBody T requestJson) {}
}
只要不需要“日期”格式,就可以正常工作。
我知道我可以用 sql 语句来做到这一点,例如 pqxx::work insert_tx(C);
pqxx::stream_to stream{
insert_tx,"CompTable",std::vector<std::string>{"TKey","AKey"}};
for (auto&& row : vector_of_vectors)
{
auto val = std::make_tuple(row.at(3),row.at(2));
stream<<val;
}
stream.complete();
insert_tx.commit();
但这不适用于 pqxx::stream_to
那么有谁知道哪种 c++ 数据类型或结构或任何与 sql 数据格式兼容的内容?
感谢您的时间和想法:)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)