tnie / testsoci Goto Github PK
View Code? Open in Web Editor NEW插入耗时试验;并发读写试验。soci+sqlite3 写不出通用的并发模型,针对具体场景支撑到什么程度而已。
插入耗时试验;并发读写试验。soci+sqlite3 写不出通用的并发模型,针对具体场景支撑到什么程度而已。
在项目属性 include 路径中,直接添加 xxx/spdlog/fmt/bundle/
,并在项目中 #include "format.h"
就会报错
在项目属性 include 路径中,直接添加 xxx/spdlog/
,并在项目中 #include "fmt/bundle/format.h"
就能够编译成功
but why? Bang.. 为什么是回调引起崩溃?
int DataCache::getRanks(QID qid, const string &object, int typeRank, QUOTE_RECV_CALLBACK_PTR cb)
{
lock_guard<mutex> lock(_dbmutex);
try
{
soci::blob dv(_memory);
_memory << (SELECT_RANKS), soci::use(object), soci::into(dv);
if (auto ptr = cb.lock())
{
if (dv.get_len() > 0)
{
Dyna dd[10];
dv.read(0, (char*)dd, dv.get_len());
if (ptr) // TODO why ptr changes empty?
{
ptr->callback(qid, CB_Ranks, typeRank, &dd, dv.get_len());
}
}
}
} // 释放 blob 类型的 dv 变量
catch (soci::soci_error const &e)
{
LOGE(e.what());
return -1;
}
return 0;
}
学习 sqlite3,了解它 亲和类型 的概念
占位:soci::use()
除了形式上的一对多之外,有预处理语句的复用、效率方面的价值吗?
硬编码拼接 sql 语句时通过
fmt
库也能实现一对多
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.