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

Method dbget

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

Source from the content-addressed store, hash-verified

73 }
74
75 int dbget(acl::db_handle& db, int max) {
76 acl::string sql, key, value;
77 int i;
78 for (i = 0; i < max; i++) {
79 key.format("key-%d", i);
80 sql.format("select value from tbl_test"
81 " where key='%s'", key.c_str());
82 if (db.sql_select(sql) == false) {
83 printf("sql_select: |%s| error\r\n", sql.c_str());
84 return -1;
85 }
86 if (db.length() == 0) {
87 break;
88 }
89 db.free_result();
90 }
91 return i;
92 }
93
94 int dbupdate(acl::db_handle& db, int max) {
95 acl::string sql, key, value;

Callers

nothing calls this directly

Calls 5

free_resultMethod · 0.80
formatMethod · 0.45
c_strMethod · 0.45
sql_selectMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected