feat(lsm): start of on-disk database
This commit is contained in:
parent
eb9157281b
commit
46f89059e4
6 changed files with 199 additions and 23 deletions
|
|
@ -6,12 +6,11 @@
|
|||
#include "lsm/str.h"
|
||||
|
||||
int main() {
|
||||
lsm_str *db_path, *data_dir;
|
||||
lsm_str_init_copy(&db_path, "data/data.db");
|
||||
lsm_str *data_dir;
|
||||
lsm_str_init_copy(&data_dir, "data");
|
||||
|
||||
lsm_store *store;
|
||||
lsm_store_load(&store, db_path, data_dir);
|
||||
lsm_store_load(&store, data_dir);
|
||||
|
||||
lsm_str *key;
|
||||
lsm_str_init_copy(&key, "key");
|
||||
|
|
@ -26,6 +25,10 @@ int main() {
|
|||
lsm_entry_data_append(store, handle, data);
|
||||
}
|
||||
|
||||
if (lsm_entry_sync(store, handle) != lsm_error_ok) {
|
||||
printf("godver");
|
||||
return 1;
|
||||
}
|
||||
lsm_entry_close(handle);
|
||||
|
||||
assert(lsm_store_open_read(&handle, store, key) == lsm_error_ok);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue