| 53 | } |
| 54 | |
| 55 | int dbadd(acl::db_handle& db, int max) { |
| 56 | acl::string sql; |
| 57 | assert(db.begin_transaction()); |
| 58 | for (int i = 0; i < max; i++) { |
| 59 | sql.format("insert into tbl_test('key', 'value')" |
| 60 | " values('key-%d', 'value-%d')", i, i); |
| 61 | if (db.sql_update(sql) == false) { |
| 62 | printf("sql_update: |%s| error\r\n", sql.c_str()); |
| 63 | return -1; |
| 64 | } |
| 65 | |
| 66 | if (i > 0 && i % 1000 == 0) { |
| 67 | assert(db.commit()); |
| 68 | assert(db.begin_transaction()); |
| 69 | } |
| 70 | } |
| 71 | assert(db.commit()); |
| 72 | return max; |
| 73 | } |
| 74 | |
| 75 | int dbget(acl::db_handle& db, int max) { |
| 76 | acl::string sql, key, value; |
nothing calls this directly
no test coverage detected