Newer
Older
#ifndef __VEREIGN_KVSTORE_SQLITE_STORAGE_HH
#define __VEREIGN_KVSTORE_SQLITE_STORAGE_HH
#include <vereign/kvstore/storage.hh>
#include <vereign/sqlite/connection.hh>
namespace vereign::kvstore {
class SqliteStorage : public Storage {
public:
SqliteStorage(const std::string& db_path);
~SqliteStorage() override;
SqliteStorage(const SqliteStorage&) = delete;
auto operator=(const SqliteStorage&) -> SqliteStorage& = delete;
void Lock() override;
void Unlock() override;
void PutBytes(const std::string& key, bytes::View value) override;
void GetBytes(const std::string& key, bytes::Buffer& value) override;
void PutInt64(const std::string& key, int64_t value) override;
auto GetInt64(const std::string& key) -> int64_t override;
private:
sqlite::Connection db_;
};
} // namespace vereign::kvstore
#endif // __VEREIGN_KVSTORE_SQLITE_STORAGE_HH