NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::tenant::ScopedStore Class Referencefinal

Store namespace owned by one trusted tenant. More...

#include <tenant.h>

Inheritance diagram for neograph::tenant::ScopedStore:
[legend]
Collaboration diagram for neograph::tenant::ScopedStore:
[legend]

Public Member Functions

void delete_item (const graph::Namespace &ns, const std::string &key) override
 Delete a single item.
 
std::optional< graph::StoreItem > get (const graph::Namespace &ns, const std::string &key) const override
 Retrieve a single item.
 
std::vector< graph::Namespace > list_namespaces (const graph::Namespace &prefix={}) const override
 List all namespaces under a prefix.
 
void put (const graph::Namespace &ns, const std::string &key, const json &value) override
 Store a value (create or update).
 
std::vector< graph::StoreItem > search (const graph::Namespace &ns_prefix, int limit=100) const override
 Search items under a namespace prefix.
 

Detailed Description

Store namespace owned by one trusted tenant.

The backend can be shared by tenants; all namespace operations are prefixed with an unambiguous length encoded tenant namespace.

Definition at line 134 of file tenant.h.

Member Function Documentation

◆ delete_item()

void neograph::tenant::ScopedStore::delete_item ( const graph::Namespace &  ns,
const std::string &  key 
)
overridevirtual

Delete a single item.

Parameters
nsNamespace path.
keyItem key to delete.

Implements neograph::graph::Store.

◆ get()

std::optional< graph::StoreItem > neograph::tenant::ScopedStore::get ( const graph::Namespace &  ns,
const std::string &  key 
) const
overridevirtual

Retrieve a single item.

Parameters
nsNamespace path.
keyItem key.
Returns
The item, or std::nullopt if not found.

Implements neograph::graph::Store.

◆ list_namespaces()

std::vector< graph::Namespace > neograph::tenant::ScopedStore::list_namespaces ( const graph::Namespace &  prefix = {}) const
overridevirtual

List all namespaces under a prefix.

Parameters
prefixNamespace prefix to filter by (empty = list all).
Returns
Vector of unique Namespace paths.

Implements neograph::graph::Store.

◆ put()

void neograph::tenant::ScopedStore::put ( const graph::Namespace &  ns,
const std::string &  key,
const json &  value 
)
overridevirtual

Store a value (create or update).

Parameters
nsNamespace path for the item.
keyItem key within the namespace.
valueJSON value to store.

Implements neograph::graph::Store.

◆ search()

std::vector< graph::StoreItem > neograph::tenant::ScopedStore::search ( const graph::Namespace &  ns_prefix,
int  limit = 100 
) const
overridevirtual

Search items under a namespace prefix.

Parameters
ns_prefixNamespace prefix to match (e.g., {"users"} matches all user items).
limitMaximum number of items to return (default: 100).
Returns
Vector of matching StoreItem objects.

Implements neograph::graph::Store.


The documentation for this class was generated from the following file: