DatabaseInitRam starts an empty database in memory alone, DatabaseOpenRam serves a directory as one image, DatabaseOpenRocksdb, DatabaseOpenLeveldb and DatabaseOpenNvme serve a directory in place, and DatabaseViewRocksdb and DatabaseViewNvme serve one read-only, refusing every change with StatusReadOnly. Close writes nothing to disk, so On(executor).Flush() makes commits with DurabilityBuffered durable before it. Describe reports the engine, the isolation, the CPU class picked and the sizes the engine estimates, Clear empties every collection at once, and Compact reclaims space through the phases its engine runs, where a CompactPlan keeps a stopped compaction open until CompactPlanFinish.
The RAM engine always links, and build tags mirror the Cargo features for the others: ustore_rocksdb links librocksdb, and on Linux liburing beside it, and ustore_leveldb links libleveldb.
Build the archive with the matching USTORE_WITH_* options and point CGO_LDFLAGS at the directory holding the engine archives too, as the lib/ of a prefix CMake installed with USTORE_INSTALL does; the NVMe engine links nothing more.
go build -tags ustore_rocksdb,ustore_leveldb ./...
With those tags, a scratch database in memory and a RocksDB directory open side by side, and either one describes, clears and compacts through the same calls:
scratch, err := ustore.DatabaseInitRam(&ustore.DatabaseInitRamConfig{Isolation: ustore.IsolationSnapshot})people, err := ustore.DatabaseOpenRocksdb("/var/lib/people", nil)description, err := people.Describe()err = people.Clear(ustore.DropValues) // keeps every key, emptying its valueerr = people.Compact(nil) // reclaims what overwritten and removed data still takes
The receiver makes the completion a type, not a flag.
Each verb is written once over its parent, and the parent decides what compiles: only a transaction commits, only the head clears and compacts, and nothing writes through a snapshot.
Inputs cross as they lie.
Keys, edges and tapes are pinned in place for the call, and a collection or a role the whole batch shares crosses from the call’s own frame, so nothing is staged on the way in.
One pinned frame per call.
It holds the outcome, the argument structure, the fixed-width inputs and the result, and TestCallsAllocateOnlyTheirFrames pins the budgets below.
No life of its own.
The binding starts no goroutines, takes no locks and keeps no counts or queues, and releasing a Deferred rides Wait, Close or the collector, each of which waits for the call to be final first.
Path
Go
Rust
Blocking call
1 frame
0
Refusal before the call
1 Error
1 error
Deferred submit and wait
4: frame, Deferred, 2 in AddCleanup
0
Each callback
1 handle
0
API
Types
PagesImportConfigPagesImportConfig carries the optional arguments of DatabaseOn.PagesImport.