Closed AmdRyZen closed 2 months ago
we fixed this issue in https://github.com/an-tao/trantor/pull/331
nice
@AmdRyZen Can you confirm the lastest mater
fixed the issue for you? I want to close the issue if possible.
master 没有更新 @marty1885
@an-tao 我到现在还没找到一个 动态sql的方式 且支持 getFastDbClient 的 execSqlCoro
auto criteria = Criteria(XxlJobInfo::Cols::_id, CompareOperator::EQ, 1) && Criteria(XxlJobInfo::Cols::_author, CompareOperator::EQ, "aa"); 这种方式是阻塞的 且也不是动态的
co_await transPtr->execSqlCoro("update xxl_job_info set author = ? where id = ? limit 1", "aa", 1); 这种方式参数是固定的 "aa", 1 不能是 vec...
类似golang if len(req.TemplateName) > 0 { tx = tx.Where("template_name = ?", req.TemplateName) }
@AmdRyZen 試試手工把trantor更新?沒問題的話我發個PR更新master上的 trantor
@marty1885 我已经git submodule update --init 没有更新
@an-tao 我到现在还没找到一个 动态sql的方式 且支持 getFastDbClient 的 execSqlCoro
auto criteria = Criteria(XxlJobInfo::Cols::_id, CompareOperator::EQ, 1) && Criteria(XxlJobInfo::Cols::_author, CompareOperator::EQ, "aa"); 这种方式是阻塞的 且也不是动态的
co_await transPtr->execSqlCoro("update xxl_job_info set author = ? where id = ? limit 1", "aa", 1); 这种方式参数是固定的 "aa", 1 不能是 vec...
类似golang if len(req.TemplateName) > 0 { tx = tx.Where("template_name = ?", req.TemplateName) }
Drogon里还有个sql构建工具QueryBuilder你可以尝试
@AmdRyZen
cd trantor
git pull origin master
然後重新build
Author: Martin Chang marty1885@users.noreply.github.com Date: Wed Apr 3 13:03:18 2024 +0800
Fix build on latest c-ares (#331)
commit c92280119a6ebaf71fe6aca0d128222edd028b22
构建成功了
github/drogon/lib/src/HttpUtils.cc:62:10: warning: 'drogon::CT_APPLICATION_X_JAVASCRIPT' is deprecated: use CT_TEXT_JAVASCRIPT [-Wdeprecated-declarations] 62 | {CT_APPLICATION_X_JAVASCRIPT,
不过有个警告 看看是不是有时间改一下
@an-tao我还没有找到一个动态sql的方式且支持 getFastDbClient 的 execSqlCoro 自动标准 = Criteria(XxlJobInfo::Cols::_id, CompareOperator::EQ, 1) && Criteria(XxlJobInfo::Cols::_author, CompareOperator::EQ, "aa");这种方式是阻塞的且也不是动态的 co_await transPtr->execSqlCoro("更新 xxl_job_info setauthor = ? where id = ? limit 1", "aa", 1);这种方式参数是固定的“aa”,1 不能是 vec... 类似golang if len(req.TemplateName) > 0 { tx = tx.Where("template_name = ?", req.TemplateName) }
Drogon 里还有一个 sql 构建工具 QueryBuilder 你可以尝试
@an-tao QueryBuilder 我看demo是同步阻塞的 并不支持协成
这2 种方式也不能通用
drogon/trantor/trantor/net/inner/AresResolver.cc:127:23: error: 'void ares_gethostbyname(ares_channel_t, const char, int, ares_host_callback, void*)' is deprecated: Use ares_getaddrinfo instead [-Werror=deprecated-declarations] 127 | aresgethostbyname(ctx, |
~~~~^~~~ 128 | hostname.c_str(), |~~~~~ 129 | AF_INET, |~~~~ 130 | &AresResolver::areshostcallback, |~~~~~~~~~~ 131 | queryData);