Remove SeqNo from SqliteKeyValue.

This commit is contained in:
levlam 2021-12-12 15:41:06 +03:00
parent b1f004ab19
commit ef7ccc020a
3 changed files with 4 additions and 11 deletions

View File

@ -62,9 +62,6 @@ class SeqKeyValue {
return map_.size();
}
void reset_seq_no() {
current_id_ = 0;
}
std::unordered_map<string, string> get_all() const {
return map_;
}

View File

@ -50,7 +50,7 @@ Status SqliteKeyValue::drop() {
return result;
}
SqliteKeyValue::SeqNo SqliteKeyValue::set(Slice key, Slice value) {
void SqliteKeyValue::set(Slice key, Slice value) {
set_stmt_.bind_blob(1, key).ensure();
set_stmt_.bind_blob(2, value).ensure();
auto status = set_stmt_.step();
@ -59,7 +59,6 @@ SqliteKeyValue::SeqNo SqliteKeyValue::set(Slice key, Slice value) {
}
// set_stmt_.step().ensure();
set_stmt_.reset();
return 0;
}
string SqliteKeyValue::get(Slice key) {
@ -76,11 +75,10 @@ string SqliteKeyValue::get(Slice key) {
return data;
}
SqliteKeyValue::SeqNo SqliteKeyValue::erase(Slice key) {
void SqliteKeyValue::erase(Slice key) {
erase_stmt_.bind_blob(1, key).ensure();
erase_stmt_.step().ensure();
erase_stmt_.reset();
return 0;
}
void SqliteKeyValue::erase_by_prefix(Slice prefix) {

View File

@ -27,8 +27,6 @@ class SqliteKeyValue {
return connection.exec(PSLICE() << "CREATE TABLE IF NOT EXISTS " << table_name << " (k BLOB PRIMARY KEY, v BLOB)");
}
using SeqNo = uint64;
bool empty() const {
return db_.empty();
}
@ -41,11 +39,11 @@ class SqliteKeyValue {
Status drop();
SeqNo set(Slice key, Slice value);
void set(Slice key, Slice value);
string get(Slice key);
SeqNo erase(Slice key);
void erase(Slice key);
Status begin_read_transaction() TD_WARN_UNUSED_RESULT {
return db_.begin_read_transaction();