pub struct QueryService { /* private fields */ }
Expand description
Query service for document operations
Implementations§
Source§impl QueryService
impl QueryService
Sourcepub fn new(pool: SqlitePool) -> Self
pub fn new(pool: SqlitePool) -> Self
Create a new QueryService with the given database pool
Sourcepub async fn find_documents_by_type(
&self,
doc_type: DocumentType,
) -> Result<Vec<Document>>
pub async fn find_documents_by_type( &self, doc_type: DocumentType, ) -> Result<Vec<Document>>
Find documents by document type
Sourcepub async fn find_documents_by_type_paginated(
&self,
doc_type: DocumentType,
limit: Option<usize>,
offset: Option<usize>,
) -> Result<Vec<Document>>
pub async fn find_documents_by_type_paginated( &self, doc_type: DocumentType, limit: Option<usize>, offset: Option<usize>, ) -> Result<Vec<Document>>
Find documents by document type with pagination
Sourcepub async fn find_documents_by_phase(
&self,
phase: &str,
) -> Result<Vec<Document>>
pub async fn find_documents_by_phase( &self, phase: &str, ) -> Result<Vec<Document>>
Find documents by phase tag (e.g., “draft”, “review”, “published”)
Sourcepub async fn find_documents_by_parent(
&self,
parent_id: &str,
) -> Result<Vec<Document>>
pub async fn find_documents_by_parent( &self, parent_id: &str, ) -> Result<Vec<Document>>
Find documents by parent ID
Sourcepub async fn find_orphaned_documents(&self) -> Result<Vec<Document>>
pub async fn find_orphaned_documents(&self) -> Result<Vec<Document>>
Find orphaned documents (documents with parent_id that doesn’t exist)
Sourcepub async fn get_all_property_names(&self) -> Result<Vec<String>>
pub async fn get_all_property_names(&self) -> Result<Vec<String>>
Get all property names used in documents
Sourcepub async fn get_property_values(
&self,
prop_name: &str,
) -> Result<Vec<(String, usize)>>
pub async fn get_property_values( &self, prop_name: &str, ) -> Result<Vec<(String, usize)>>
Get all values for a specific property with usage counts
Sourcepub async fn search_by_property(
&self,
prop_name: &str,
value: &str,
) -> Result<Vec<Document>>
pub async fn search_by_property( &self, prop_name: &str, value: &str, ) -> Result<Vec<Document>>
Search documents by property value (equals only for now)
Sourcepub async fn search_content(
&self,
query: &str,
limit: usize,
) -> Result<Vec<SearchResult>>
pub async fn search_content( &self, query: &str, limit: usize, ) -> Result<Vec<SearchResult>>
Full-text search using FTS5 with ranking and snippets
Sourcepub async fn get_relationships(
&self,
document_id: &str,
direction: RelationshipDirection,
) -> Result<Vec<Relationship>>
pub async fn get_relationships( &self, document_id: &str, direction: RelationshipDirection, ) -> Result<Vec<Relationship>>
Get relationships for a document
Trait Implementations§
Source§impl Clone for QueryService
impl Clone for QueryService
Source§fn clone(&self) -> QueryService
fn clone(&self) -> QueryService
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for QueryService
impl !RefUnwindSafe for QueryService
impl Send for QueryService
impl Sync for QueryService
impl Unpin for QueryService
impl !UnwindSafe for QueryService
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more