feat(lsm): implement basic remove
This commit is contained in:
parent
51e4a203e9
commit
b40389bbe2
6 changed files with 65 additions and 8 deletions
|
|
@ -20,18 +20,13 @@ int main() {
|
|||
|
||||
lsm_str *attr;
|
||||
lsm_str_init_copy(&attr, "some attribute value");
|
||||
lsm_entry_attr_insert(handle, lsm_attr_type_content_type, attr);
|
||||
lsm_entry_attr_insert(handle, 1, attr);
|
||||
|
||||
lsm_str *data;
|
||||
lsm_str_init_copy(&data, "hello");
|
||||
|
||||
for (int i = 0; i < 50; i++) {
|
||||
lsm_entry_data_append(store, handle, data);
|
||||
}
|
||||
|
||||
if (lsm_entry_sync(store, handle) != lsm_error_ok) {
|
||||
printf("godver");
|
||||
return 1;
|
||||
lsm_entry_data_append(handle, data);
|
||||
}
|
||||
lsm_entry_close(handle);
|
||||
|
||||
|
|
@ -50,4 +45,12 @@ int main() {
|
|||
total += read;
|
||||
}
|
||||
printf("\n%lu", total);
|
||||
|
||||
lsm_entry_close(handle);
|
||||
|
||||
assert(lsm_store_open_write(&handle, store, key) == lsm_error_ok);
|
||||
lsm_entry_remove(handle);
|
||||
lsm_entry_close(handle);
|
||||
|
||||
assert(lsm_store_open_read(&handle, store, key) == lsm_error_not_found);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue