Skip to main content

Database

Struct Database 

Source
pub struct Database { /* private fields */ }

Implementations§

Source§

impl Database

Source

pub fn open(path: &Path) -> Result<Self>

Open or create database with connection pool

Source

pub fn create_entities(&self, entities: &[Entity]) -> Result<Vec<Entity>>

Create entities (returns only newly created entities) Optimized: Uses INSERT OR IGNORE with tracking, no full table scan Wrapped in transaction for atomicity

Source

pub fn create_relations(&self, relations: &[Relation]) -> Result<Vec<Relation>>

Create relations (returns only newly created relations) Optimized: Uses INSERT OR IGNORE with tracking, no full table scan Wrapped in transaction for atomicity

Source

pub fn add_observations( &self, inputs: &[ObservationInput], ) -> Result<Vec<ObservationResult>>

Add observations to multiple entities (batch operation) Wrapped in transaction for atomicity

Source

pub fn delete_entities(&self, names: &[String]) -> Result<usize>

Delete entities (cascade delete via FOREIGN KEY) Wrapped in transaction for atomicity when deleting multiple entities

Source

pub fn delete_observations( &self, deletions: &[ObservationDeletion], ) -> Result<()>

Delete observations from multiple entities (batch operation) Wrapped in transaction for atomicity

Source

pub fn delete_relations(&self, relations: &[Relation]) -> Result<usize>

Delete relations Wrapped in transaction for atomicity

Source

pub fn read_graph(&self) -> Result<KnowledgeGraph>

Read entire graph

Source

pub fn search_nodes(&self, query: Option<&str>) -> Result<KnowledgeGraph>

Search using FTS5 full-text search

Source

pub fn open_nodes(&self, names: &[String]) -> Result<KnowledgeGraph>

Open specific nodes by names

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V