pub struct Database<S> { /* private fields */ }Expand description
Owns the graph store and orchestrates parse → analyze → compile → execute.
Implementations§
Source§impl Database<InMemoryGraph>
impl Database<InMemoryGraph>
Source§impl<S> Database<S>where
S: GraphStorage + GraphStorageMut,
impl<S> Database<S>where
S: GraphStorage + GraphStorageMut,
Sourcepub fn from_graph(graph: S) -> Self
pub fn from_graph(graph: S) -> Self
Build a database by taking ownership of a bare graph store.
Sourcepub fn store(&self) -> &Arc<Mutex<S>>
pub fn store(&self) -> &Arc<Mutex<S>>
Handle to the underlying shared store — useful for callers that need to snapshot or share the graph across multiple databases.
Sourcepub fn parse(&self, query: &str) -> Result<Document>
pub fn parse(&self, query: &str) -> Result<Document>
Parse a query string into an AST without executing it.
Sourcepub fn execute(
&self,
query: &str,
options: Option<ExecuteOptions>,
) -> Result<QueryResult>
pub fn execute( &self, query: &str, options: Option<ExecuteOptions>, ) -> Result<QueryResult>
Execute a query and return its result.
Sourcepub fn execute_with_params(
&self,
query: &str,
options: Option<ExecuteOptions>,
params: BTreeMap<String, LoraValue>,
) -> Result<QueryResult>
pub fn execute_with_params( &self, query: &str, options: Option<ExecuteOptions>, params: BTreeMap<String, LoraValue>, ) -> Result<QueryResult>
Execute a query with bound parameters.
Trait Implementations§
Source§impl<S> QueryRunner for Database<S>
impl<S> QueryRunner for Database<S>
fn execute( &self, query: &str, options: Option<ExecuteOptions>, ) -> Result<QueryResult>
Auto Trait Implementations§
impl<S> Freeze for Database<S>
impl<S> RefUnwindSafe for Database<S>
impl<S> Send for Database<S>where
S: Send,
impl<S> Sync for Database<S>where
S: Send,
impl<S> Unpin for Database<S>
impl<S> UnsafeUnpin for Database<S>
impl<S> UnwindSafe for Database<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more