pub struct SqliteGraph { /* private fields */ }Expand description
SQLite-backed GraphBackend over one mutex-guarded connection.
Opening applies the schema and runs any pending migrations, so a database
created by an older llm-kernel is upgraded transparently on open.
Implementations§
Source§impl SqliteGraph
impl SqliteGraph
Source§impl SqliteGraph
CJK-aware convenience methods (available with the graph-cjk feature).
impl SqliteGraph
CJK-aware convenience methods (available with the graph-cjk feature).
Sourcepub fn search_nodes_cjk(
&self,
query: &str,
limit: usize,
) -> Result<Vec<GraphNode>>
pub fn search_nodes_cjk( &self, query: &str, limit: usize, ) -> Result<Vec<GraphNode>>
CJK (or mixed) search via contiguous substring matching.
Delegates to crate::graph::cjk::search_nodes_cjk; see its docs for
the matching semantics.
Sourcepub fn segment_cjk(text: &str) -> String
pub fn segment_cjk(text: &str) -> String
Segment a string for CJK tokenization (exposed for callers that want to pre-process queries or inspect tokenization).
Trait Implementations§
Source§impl GraphBackend for SqliteGraph
impl GraphBackend for SqliteGraph
Source§fn read_node(&self, id: &str) -> Result<Option<GraphNode>>
fn read_node(&self, id: &str) -> Result<Option<GraphNode>>
Read a single node by ID (
None if absent).Source§fn delete_node(&self, id: &str) -> Result<bool>
fn delete_node(&self, id: &str) -> Result<bool>
Delete a node by ID. Returns
true if a row was removed.Source§fn search_nodes(&self, query: &str, limit: usize) -> Result<Vec<GraphNode>>
fn search_nodes(&self, query: &str, limit: usize) -> Result<Vec<GraphNode>>
FTS5 full-text search, ranked by importance DESC.
Source§fn query_nodes(
&self,
tag: Option<&str>,
node_type: Option<&str>,
project: Option<&str>,
limit: usize,
) -> Result<Vec<GraphNode>>
fn query_nodes( &self, tag: Option<&str>, node_type: Option<&str>, project: Option<&str>, limit: usize, ) -> Result<Vec<GraphNode>>
Dynamic filter by tag / node_type / project.
Source§fn smart_recall(
&self,
project: Option<&str>,
hint: Option<&str>,
limit: usize,
) -> Result<Vec<ScoredNode>>
fn smart_recall( &self, project: Option<&str>, hint: Option<&str>, limit: usize, ) -> Result<Vec<ScoredNode>>
Composite recall — rank nodes by recency, importance, access, FTS, and
graph boost. The canonical high-level read path for “what’s relevant”.
BFS-traverse up to
depth hops from start_id, returning related node
IDs (excluding the start).Source§fn append_edge(&self, edge: &GraphEdge) -> Result<()>
fn append_edge(&self, edge: &GraphEdge) -> Result<()>
Append an edge (duplicates by edge ID are ignored).
Source§fn edges_for_node(&self, node_id: &str) -> Result<Vec<GraphEdge>>
fn edges_for_node(&self, node_id: &str) -> Result<Vec<GraphEdge>>
Read edges where the given node is source or target.
Source§fn delete_edge(&self, id: &str) -> Result<bool>
fn delete_edge(&self, id: &str) -> Result<bool>
Delete an edge by ID. Returns
true if a row was removed.Source§fn remove_edges_for_node(&self, node_id: &str) -> Result<()>
fn remove_edges_for_node(&self, node_id: &str) -> Result<()>
Remove every edge connected to a node.
Source§fn current_version(&self) -> Result<u32>
fn current_version(&self) -> Result<u32>
Recorded schema version for this backend.
Auto Trait Implementations§
impl !Freeze for SqliteGraph
impl RefUnwindSafe for SqliteGraph
impl Send for SqliteGraph
impl Sync for SqliteGraph
impl Unpin for SqliteGraph
impl UnsafeUnpin for SqliteGraph
impl UnwindSafe for SqliteGraph
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.