Remove SeqNo from SqliteKeyValue.
This commit is contained in:
parent
b1f004ab19
commit
ef7ccc020a
@ -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_;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user