Struct holmes::pg::PgDB [] [src]

pub struct PgDB { /* fields omitted */ }

Object representing a postgres-backed fact database instance

Methods

impl PgDB
[src]

Create a new PgDB object by passing in a Postgres connection string

Kick everyone off the database and destroy the data at the provided URI

Trait Implementations

impl FactDB for PgDB
[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.

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.

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.

Fetches a predicate by name

Persists a predicate by name The name must consist only of lower case ASCII and _, anything else will be rejected. This restriction is because the predicate name is currently used to construct the table name.

In the future, this restriction could be lifted by generating table names rather than using the names of predicates, but this helps a lot with debugging for now.

Attempt to match the right hand side of a datalog rule against the database, returning a list of solution assignments to the bound variables.