MCPcopy Create free account
hub / github.com/acl-dev/acl / run

Method run

lib_acl_cpp/samples/benchmark/sqlite/main.cpp:23–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21 acl::atomic_long& count_;
22
23 void* run(void) {
24 acl::db_sqlite db(dbpath_, "gbk");
25
26 if (db.open() == false) {
27 printf("open %s error\r\n", dbpath_.c_str());
28 return NULL;
29 }
30
31 if (tbl_create(db, "tbl_test") == false) {
32 return NULL;
33 }
34
35 int ret;
36 if (action_ == "add") {
37 ret = dbadd(db, max_);
38 } else if (action_ == "get") {
39 ret = dbget(db, max_);
40 } else if (action_ == "update") {
41 ret = dbupdate(db, max_);
42 } else if (action_ == "del") {
43 ret = dbdel(db, max_);
44 } else {
45 printf("unknown action: %s\r\n", action_.c_str());
46 return NULL;
47 }
48 printf("db-%s: %d\r\n", action_.c_str(), ret);
49 if (ret > 0) {
50 count_ += ret;
51 }
52 return NULL;
53 }
54
55 int dbadd(acl::db_handle& db, int max) {
56 acl::string sql;

Callers

nothing calls this directly

Calls 3

tbl_createFunction · 0.50
openMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected