Struct mentat_ffi::Store
[−]
pub struct Store { /* fields omitted */ }
A convenience wrapper around a single SQLite connection and a Conn. This is suitable for applications that don't require complex connection management.
Methods
impl Store
impl Store
pub fn open(path: &str) -> Result<Store, Error>
pub fn open(path: &str) -> Result<Store, Error>
Open a store at the supplied path, ensuring that it includes the bootstrap schema.
pub fn open_empty(path: &str) -> Result<Store, Error>
pub fn open_empty(path: &str) -> Result<Store, Error>
Returns a totally blank store with no bootstrap schema. Use open
instead.
pub fn transact(&mut self, transaction: &str) -> Result<TxReport, Error>
pub fn transact(&mut self, transaction: &str) -> Result<TxReport, Error>
impl Store
impl Store
pub fn sqlite_mut(&mut self) -> &mut Connection
pub fn sqlite_mut(&mut self) -> &mut Connection
Intended for use from tests.
impl Store
impl Store
pub fn dismantle(self) -> (Connection, Conn)
pub fn dismantle(self) -> (Connection, Conn)
pub fn conn(&self) -> &Conn
pub fn conn(&self) -> &Conn
pub fn begin_read(&'m mut self) -> Result<InProgressRead<'m, 'm>, Error>
pub fn begin_read(&'m mut self) -> Result<InProgressRead<'m, 'm>, Error>
pub fn begin_transaction(&'m mut self) -> Result<InProgress<'m, 'm>, Error>
pub fn begin_transaction(&'m mut self) -> Result<InProgress<'m, 'm>, Error>
pub fn cache(
&mut self,
attr: &Keyword,
direction: CacheDirection
) -> Result<(), Error>
pub fn cache(
&mut self,
attr: &Keyword,
direction: CacheDirection
) -> Result<(), Error>
pub fn register_observer(&mut self, key: String, observer: Arc<TxObserver>)
pub fn register_observer(&mut self, key: String, observer: Arc<TxObserver>)
pub fn unregister_observer(&mut self, key: &String)
pub fn unregister_observer(&mut self, key: &String)
Trait Implementations
impl Syncable for Store
impl Syncable for Store
impl Pullable for Store
impl Pullable for Store
fn pull_attributes_for_entities<E, A>(
&self,
entities: E,
attributes: A
) -> Result<BTreeMap<i64, Arc<StructuredMap>>, Error> where
A: IntoIterator<Item = i64>,
E: IntoIterator<Item = i64>,
fn pull_attributes_for_entities<E, A>(
&self,
entities: E,
attributes: A
) -> Result<BTreeMap<i64, Arc<StructuredMap>>, Error> where
A: IntoIterator<Item = i64>,
E: IntoIterator<Item = i64>,
fn pull_attributes_for_entity<A>(
&self,
entity: i64,
attributes: A
) -> Result<StructuredMap, Error> where
A: IntoIterator<Item = i64>,
fn pull_attributes_for_entity<A>(
&self,
entity: i64,
attributes: A
) -> Result<StructuredMap, Error> where
A: IntoIterator<Item = i64>,
impl Queryable for Store
impl Queryable for Store
fn q_once<T>(&self, query: &str, inputs: T) -> Result<QueryOutput, Error> where
T: Into<Option<QueryInputs>>,
fn q_once<T>(&self, query: &str, inputs: T) -> Result<QueryOutput, Error> where
T: Into<Option<QueryInputs>>,
fn q_prepare<T>(&self, query: &str, inputs: T) -> Result<PreparedQuery, Error> where
T: Into<Option<QueryInputs>>,
fn q_prepare<T>(&self, query: &str, inputs: T) -> Result<PreparedQuery, Error> where
T: Into<Option<QueryInputs>>,
fn q_explain<T>(
&self,
query: &str,
inputs: T
) -> Result<QueryExplanation, Error> where
T: Into<Option<QueryInputs>>,
fn q_explain<T>(
&self,
query: &str,
inputs: T
) -> Result<QueryExplanation, Error> where
T: Into<Option<QueryInputs>>,
fn lookup_values_for_attribute<E>(
&self,
entity: E,
attribute: &Keyword
) -> Result<Vec<TypedValue>, Error> where
E: Into<i64>,
fn lookup_values_for_attribute<E>(
&self,
entity: E,
attribute: &Keyword
) -> Result<Vec<TypedValue>, Error> where
E: Into<i64>,
fn lookup_value_for_attribute<E>(
&self,
entity: E,
attribute: &Keyword
) -> Result<Option<TypedValue>, Error> where
E: Into<i64>,
fn lookup_value_for_attribute<E>(
&self,
entity: E,
attribute: &Keyword
) -> Result<Option<TypedValue>, Error> where
E: Into<i64>,