Struct holmes::mem_db::MemDB [] [src]

pub struct MemDB { /* fields omitted */ }

MemDB is an in-memory mock up of the fact database interface.

While it can be useful for quick tests, it should not be depended on for anything serious, even if you want a standalone app. It is very slow and persists nothing.

MemDB does not currently support projections in any meaninful way. It will treat all projections as though they are simply the next column in sequence for the predicate they are attached to.

Methods

impl MemDB
[src]

Creates a fresh empty MemDB.

Trait Implementations

impl FactDB for MemDB
[src]

FactDB implementation provided error type

Creates a cache table for a new rule, returning a handle

Update

Adds a new fact to the database, returning false if the fact was already present in the database, and true if it was inserted. Read more

Registers a new type with the database. This is unstable, and will likely need to be moved to the initialization of the database object in order to allow reconnecting to an existing database. Read more

Looks for a named type in the database's registry. This function is primarily useful for the DSL shorthand for constructing queries, since it allows you to use names of types when declaring functions rather than type objects. Read more

Fetches a predicate by name

Persists a predicate by name

Attempt to match the right hand side of a datalog rule against the database, returning a list of solution assignments to the bound variables. Optionally provide a cache handle to have the db filter already processed results based on a provided cache. Read more