pub struct Database { /* private fields */ }Expand description
A compiled and executed Mangle database.
Thread-safe: queries take a read lock, mutations take a write lock.
Implementations§
Source§impl Database
impl Database
Sourcepub fn open(config: DatabaseConfig) -> Result<Self>
pub fn open(config: DatabaseConfig) -> Result<Self>
Open a database: compile the program, load EDB, execute, serve queries.
Sourcepub fn insert(&self, relation: &str, tuple: Vec<Value>) -> Result<()>
pub fn insert(&self, relation: &str, tuple: Vec<Value>) -> Result<()>
Insert a fact into an EDB relation and recompute IDB.
Sourcepub fn retract(&self, relation: &str, tuple: &[Value]) -> Result<()>
pub fn retract(&self, relation: &str, tuple: &[Value]) -> Result<()>
Retract a fact from an EDB relation and recompute IDB.
Sourcepub fn relation_names(&self) -> Result<Vec<String>>
pub fn relation_names(&self) -> Result<Vec<String>>
Returns the names of all relations in the store.
Auto Trait Implementations§
impl !Freeze for Database
impl !RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnsafeUnpin for Database
impl !UnwindSafe for Database
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