This commit is contained in:
aozhiwei 2019-02-11 21:59:17 +08:00
parent 22d1f68061
commit 5156f6eb84

View File

@ -42,18 +42,22 @@ static void Test()
conn_info->SetVal("host", a8::XValue("127.0.0.1"));
conn_info->SetVal("port", a8::XValue(3306));
conn_info->SetVal("user", a8::XValue("root"));
conn_info->SetVal("passwd", a8::XValue("passwd"));
conn_info->SetVal("passwd", a8::XValue("keji178"));
conn_info->SetVal("database", a8::XValue("gamedb1008_6"));
f8::DBPool::Instance()->ExecAsyncQuery(
*conn_info,
"SELECT 1;",
"SELECT 1 UNION SELECT 2 UNION SELECT 3;",
{},
a8::XParams(),
[] (a8::XParams& param, const f8::DataSet* data_set)
{
for (auto& row : *data_set) {
printf("%s\n", row.at(0).c_str());
}
},
[] (a8::XParams& param, int error_code, const std::string& error_msg)
{
printf("error_msg:%s\n", error_msg.c_str());
}
,
rand());