tooluniverse.cache.sqlite_backend module

SQLite-backed persistent cache for ToolUniverse.

The cache stores serialized tool results with TTL and version metadata. Designed to be a drop-in persistent layer behind the in-memory cache.

class tooluniverse.cache.sqlite_backend.CacheEntry[source]

Bases: object

CacheEntry(key: ‘str’, value: ‘Any’, namespace: ‘str’, version: ‘str’, ttl: ‘Optional[int]’, created_at: ‘float’, last_accessed: ‘float’, hit_count: ‘int’)

key: str
value: Any
namespace: str
version: str
ttl: int | None
created_at: float
last_accessed: float
hit_count: int
__init__(key, value, namespace, version, ttl, created_at, last_accessed, hit_count)
class tooluniverse.cache.sqlite_backend.PersistentCache[source]

Bases: object

SQLite-backed cache layer with TTL support.

__init__(path, *, enable=True)[source]
close()[source]
cleanup_expired()[source]
get(cache_key)[source]
set(cache_key, value, *, namespace, version, ttl)[source]
delete(cache_key)[source]
clear(namespace=None)[source]
iter_entries(namespace=None)[source]
stats()[source]