storehost

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package storehost is the synchronous SQLite host of ABI section 3 for the store alone: tooling that drives store.Store (the benchmark engine, the storage-conformance provider) applies a step's commits and answers its reads with it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {

	// B is the builder the store writes its steps into.
	B *abi.Builder
	// contains filtered or unexported fields
}

Host applies the commits a core step emits, one transaction each, answers its reads, and records every commit in the trace when it has one.

func Open

func Open(path string, trace *contracttest.Writer) (*Host, error)

Open opens (creating it if needed) the store file at path in WAL mode. trace may be nil.

func (*Host) Close

func (h *Host) Close() error

Close checkpoints the WAL and closes the file.

func (*Host) RecordType

func (h *Host) RecordType(id int64) (string, error)

apply runs the commits of the current step: each in its own transaction, except that a run of joined commits (the batches of one Storage call, ABI section 4.4) is one transaction. A trace line follows each commit once the store holds it, so a process killed after commit k leaves the commit in the store and in the trace. RecordType is the record_ids type that owns id, or "" when no committed record does.

func (*Host) Run

func (h *Host) Run(st *store.Store, f func() error) error

Run calls f until it stops returning store.ErrPending (the core's read deferral: f runs again from the top once the rows are in) and applies the commits f emits.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL