Skip to main content

Crate bkndb

Crate bkndb 

Source

Modules§

db
Db<B>: one shared backend, three facades. Replaces manually calling GraphDb::from_arc/RelationalDb::from_arc on the same cloned Arc<B> — this type is exactly that pattern, wrapped once.
graph
hybrid
kv
Raw KV facade over a shared StorageBackend — the “everything else” escape hatch alongside crate::graph::GraphDb and crate::relational::RelationalDb, for callers who want direct key/value access without going through either typed layer. Unlike calling backend.begin_read()/begin_write() directly, every table name passed here is checked against crate::RESERVED_TABLE_NAMES first, so a caller can never accidentally corrupt bkndb-core’s own internal tables the way an app-level RelSchema named "meta" once did.
lang
Text query languages layered over the builder APIs:
relational
value
Value type shared by the graph layer’s node/edge properties and the relational layer’s row columns — reusing one type is what makes a graph node’s property and a relational cell interchangeable without a conversion layer.

Structs§

BknDb
The primary user-facing database handle for BknDb, backed by RedbStorageBackend for single-file ACID on-disk persistence (.bkndb).
Db
DbReadBatch
DbStats
Logical size of a database — see Db::stats.
DbWriteBatch
IntegrityReport
Summary returned by RedbStorageBackend::verify_integrity.
MemoryStorageBackend
In-memory backend for tests and WASM targets without filesystem access.
RedbStats
Point-in-time storage figures for a Redb-backed database file.
RedbStorageBackend
Disk-backed storage engine used on desktop, mobile, and embedded Linux.
SyncBatch
A structured batch of graph nodes, graph edges, and relational rows designed for high-performance atomic synchronization (e.g. codebase-recall indexing).
SyncBatchResult
The result of executing a SyncBatch, returning the sequential IDs and primary keys generated during the atomic transaction.
TableSpec
Identifies a logical table within a backend. M1 only deals in raw byte tables; typed node/edge tables (M2+) are layered on top of this by (de)serializing before calling put/get.

Enums§

BknError
NodeRef
An edge endpoint in a SyncBatch: an existing node, or the node at index in this batch’s nodes (whose id isn’t known until it runs).

Constants§

RESERVED_TABLE_NAMES

Traits§

StorageBackend
StorageReadTx
StorageWriteTx

Functions§

check_table_name
is_reserved

Type Aliases§

KvIter
KvPairs
A lazily-evaluated, ascending stream of (key, value) pairs from one table — see StorageReadTx::scan. Owned (key, value) pairs, as returned by StorageReadTx::range.