aarondb/shared/ownership

Types

Optional executable registrations and extensions.

pub type Extensions {
  Extensions(
    functions: dict.Dict(
      String,
      fn(state.DbState, Int, Int, List(fact.Value)) -> List(
        #(fact.Eid, String, fact.Value),
      ),
    ),
    composites: List(List(String)),
    registry: dict.Dict(String, state.IndexAdapter),
    extensions: dict.Dict(String, state.ExtensionInstance),
    predicates: dict.Dict(String, fn(fact.Value) -> Bool),
    stored_rules: List(ast.Rule),
    virtual_predicates: dict.Dict(String, state.VirtualAdapter),
  )
}

Constructors

The immutable domain facts and primary indexes in a database snapshot.

pub type Facts {
  Facts(
    eavt: dict.Dict(fact.EntityId, List(fact.Datom)),
    aevt: dict.Dict(String, List(fact.Datom)),
    avet: dict.Dict(String, dict.Dict(fact.Value, fact.EntityId)),
    latest_tx: Int,
    schema: dict.Dict(String, fact.AttributeConfig),
  )
}

Constructors

Derived indexes owned by the state transition layer.

pub type Indexes {
  Indexes(
    vec_index: vec_index.VecIndex,
    bm25_indices: dict.Dict(String, bm25.BM25Index),
    art_index: art.Art,
    columnar_store: dict.Dict(String, List(internal.StorageChunk)),
  )
}

Constructors

Operational policy and bounded observability.

pub type Operations {
  Operations(
    config: state.Config,
    query_history: List(state.QueryContext),
  )
}

Constructors

Runtime handles deliberately kept outside the deterministic domain.

pub type Runtime {
  Runtime(
    adapter: storage.StorageAdapter,
    subscribers: List(process.Subject(List(fact.Datom))),
    reactive_actor: process.Subject(state.ReactiveMessage),
    followers: List(process.Pid),
    is_distributed: Bool,
    ets_name: option.Option(String),
  )
}

Constructors

A total, explicit ownership projection of the legacy public state record.

pub type View {
  View(
    facts: Facts,
    indexes: Indexes,
    runtime: Runtime,
    extensions: Extensions,
    operations: Operations,
  )
}

Constructors

Values

pub fn view(db: state.DbState) -> View
Search Document