leveldb icon indicating copy to clipboard operation
leveldb copied to clipboard

new issue

Open M-Orziboyev opened this issue 1 year ago • 3 comments

Hi!

I am a newbie of learning levelDB, yet I followed the document to write a test code, it could't run, the detailed code is: #include #include #include <leveldb/db.h>

int main(void) { leveldb::DB *db = nullptr; leveldb::Options options; options.create_if_missing = true; leveldb::Status status = leveldb::DB::Open(options, "/tmp/testdb", &db); assert(status.ok());

std::string key = "A";
std::string value = "a";
std::string get_value;

leveldb::Status s = db->Put(leveldb::WriteOptions(), key, value);

if (s.ok())
    s = db->Get(leveldb::ReadOptions(), "A", &get_value);

if (s.ok())
    std::cout << get_value << std::endl;
else
    std::cout << s.ToString() << std::endl;

delete db;

return 0;

}

M-Orziboyev avatar Mar 08 '23 20:03 M-Orziboyev