Relational NT
A relational database kernel shaped around NT-style object management.
Loading...
Searching...
No Matches
SqliteBackend.h
Go to the documentation of this file.
1#pragma once
2
3#include "Api.h"
4#include "IStorageBackend.h"
5
6#include <sqlite3.h>
7#include <string>
8#include <vector>
9
23
24namespace nt {
26 public:
32 explicit SqliteBackend(const std::string& path = ":memory:");
33 ~SqliteBackend() override;
34
35 std::string Put(std::vector<uint8_t> value) override;
36 std::optional<std::vector<uint8_t>> Get(const std::string& hash) override;
37
38 private:
39 sqlite3* db_ = nullptr;
40 };
41} // namespace nt
Defines symbol visibility for the Relational NT public API.
Abstract KV storage backend consumed by CursorManager and Merkle.
Contract between CursorManager / Merkle and a physical storage engine.
Definition IStorageBackend.h:31
SqliteBackend(const std::string &path=":memory:")
Opens (or creates) a SQLite database at path.
Definition SqliteBackend.cpp:7
std::optional< std::vector< uint8_t > > Get(const std::string &hash) override
Retrieves bytes by their SHA256 hex hash.
Definition SqliteBackend.cpp:41
std::string Put(std::vector< uint8_t > value) override
Stores a serialized value and returns its SHA256 hex hash.
Definition SqliteBackend.cpp:28
Contains the Relational NT runtime managers and API facade.