Struct mentat::conn::Conn
[−]
[src]
pub struct Conn { /* fields omitted */ }
A mutable, safe reference to the current Mentat store.
Methods
impl Conn
[src]
impl Conn
pub fn connect(sqlite: &mut Connection) -> Result<Conn>
[src]
pub fn connect(sqlite: &mut Connection) -> Result<Conn>
pub fn current_schema(&self) -> Arc<Schema>
[src]
pub fn current_schema(&self) -> Arc<Schema>
Yield a clone of the current Schema
instance.
pub fn current_cache(&self) -> SQLiteAttributeCache
[src]
pub fn current_cache(&self) -> SQLiteAttributeCache
pub fn q_once<T>(
&self,
sqlite: &Connection,
query: &str,
inputs: T
) -> Result<QueryOutput> where
T: Into<Option<QueryInputs>>,
[src]
pub fn q_once<T>(
&self,
sqlite: &Connection,
query: &str,
inputs: T
) -> Result<QueryOutput> where
T: Into<Option<QueryInputs>>,
Query the Mentat store, using the given connection and the current metadata.
pub fn q_uncached<T>(
&self,
sqlite: &Connection,
query: &str,
inputs: T
) -> Result<QueryOutput> where
T: Into<Option<QueryInputs>>,
[src]
pub fn q_uncached<T>(
&self,
sqlite: &Connection,
query: &str,
inputs: T
) -> Result<QueryOutput> where
T: Into<Option<QueryInputs>>,
Query the Mentat store, using the given connection and the current metadata, but without using the cache.
pub fn q_prepare<'sqlite, 'query, T>(
&self,
sqlite: &'sqlite Connection,
query: &'query str,
inputs: T
) -> PreparedResult<'sqlite> where
T: Into<Option<QueryInputs>>,
[src]
pub fn q_prepare<'sqlite, 'query, T>(
&self,
sqlite: &'sqlite Connection,
query: &'query str,
inputs: T
) -> PreparedResult<'sqlite> where
T: Into<Option<QueryInputs>>,
pub fn q_explain<T>(
&self,
sqlite: &Connection,
query: &str,
inputs: T
) -> Result<QueryExplanation> where
T: Into<Option<QueryInputs>>,
[src]
pub fn q_explain<T>(
&self,
sqlite: &Connection,
query: &str,
inputs: T
) -> Result<QueryExplanation> where
T: Into<Option<QueryInputs>>,
pub fn pull_attributes_for_entities<E, A>(
&self,
sqlite: &Connection,
entities: E,
attributes: A
) -> Result<BTreeMap<Entid, ValueRc<StructuredMap>>> where
E: IntoIterator<Item = Entid>,
A: IntoIterator<Item = Entid>,
[src]
pub fn pull_attributes_for_entities<E, A>(
&self,
sqlite: &Connection,
entities: E,
attributes: A
) -> Result<BTreeMap<Entid, ValueRc<StructuredMap>>> where
E: IntoIterator<Item = Entid>,
A: IntoIterator<Item = Entid>,
pub fn pull_attributes_for_entity<A>(
&self,
sqlite: &Connection,
entity: Entid,
attributes: A
) -> Result<StructuredMap> where
A: IntoIterator<Item = Entid>,
[src]
pub fn pull_attributes_for_entity<A>(
&self,
sqlite: &Connection,
entity: Entid,
attributes: A
) -> Result<StructuredMap> where
A: IntoIterator<Item = Entid>,
pub fn lookup_values_for_attribute(
&self,
sqlite: &Connection,
entity: Entid,
attribute: &Keyword
) -> Result<Vec<TypedValue>>
[src]
pub fn lookup_values_for_attribute(
&self,
sqlite: &Connection,
entity: Entid,
attribute: &Keyword
) -> Result<Vec<TypedValue>>
pub fn lookup_value_for_attribute(
&self,
sqlite: &Connection,
entity: Entid,
attribute: &Keyword
) -> Result<Option<TypedValue>>
[src]
pub fn lookup_value_for_attribute(
&self,
sqlite: &Connection,
entity: Entid,
attribute: &Keyword
) -> Result<Option<TypedValue>>
pub fn begin_read<'m, 'conn>(
&'m mut self,
sqlite: &'conn mut Connection
) -> Result<InProgressRead<'m, 'conn>>
[src]
pub fn begin_read<'m, 'conn>(
&'m mut self,
sqlite: &'conn mut Connection
) -> Result<InProgressRead<'m, 'conn>>
pub fn begin_uncached_read<'m, 'conn>(
&'m mut self,
sqlite: &'conn mut Connection
) -> Result<InProgressRead<'m, 'conn>>
[src]
pub fn begin_uncached_read<'m, 'conn>(
&'m mut self,
sqlite: &'conn mut Connection
) -> Result<InProgressRead<'m, 'conn>>
pub fn begin_transaction<'m, 'conn>(
&'m mut self,
sqlite: &'conn mut Connection
) -> Result<InProgress<'m, 'conn>>
[src]
pub fn begin_transaction<'m, 'conn>(
&'m mut self,
sqlite: &'conn mut Connection
) -> Result<InProgress<'m, 'conn>>
IMMEDIATE means 'start the transaction now, but don't exclude readers'. It prevents other
connections from taking immediate or exclusive transactions. This is appropriate for our
writes and InProgress
: it means we are ready to write whenever we want to, and nobody else
can start a transaction that's not DEFERRED
, but we don't need exclusivity yet.
pub fn transact<B>(
&mut self,
sqlite: &mut Connection,
transaction: B
) -> Result<TxReport> where
B: Borrow<str>,
[src]
pub fn transact<B>(
&mut self,
sqlite: &mut Connection,
transaction: B
) -> Result<TxReport> where
B: Borrow<str>,
Transact entities against the Mentat store, using the given connection and the current metadata.
pub fn cache(
&mut self,
sqlite: &mut Connection,
schema: &Schema,
attribute: &Keyword,
cache_direction: CacheDirection,
cache_action: CacheAction
) -> Result<()>
[src]
pub fn cache(
&mut self,
sqlite: &mut Connection,
schema: &Schema,
attribute: &Keyword,
cache_direction: CacheDirection,
cache_action: CacheAction
) -> Result<()>
Adds or removes the values of a given attribute to an in-memory cache.
The attribute should be a namespaced string: e.g., :foo/bar
.
cache_action
determines if the attribute should be added or removed from the cache.
CacheAction::Add is idempotent - each attribute is only added once.
CacheAction::Remove throws an error if the attribute does not currently exist in the cache.
pub fn register_observer(&mut self, key: String, observer: Arc<TxObserver>)
[src]
pub fn register_observer(&mut self, key: String, observer: Arc<TxObserver>)
pub fn unregister_observer(&mut self, key: &String)
[src]
pub fn unregister_observer(&mut self, key: &String)