pub struct IndexManager<'a> { /* private fields */ }Expand description
Helpers for managing lightweight indexes on claw-core tables.
All methods are idempotent and safe to call multiple times (they use
IF NOT EXISTS guards internally).
Implementations§
Source§impl<'a> IndexManager<'a>
impl<'a> IndexManager<'a>
Sourcepub fn new(pool: &'a SqlitePool) -> Self
pub fn new(pool: &'a SqlitePool) -> Self
Create a new IndexManager bound to pool.
Sourcepub async fn ensure_active_memory_agent_index(&self) -> ClawResult<()>
pub async fn ensure_active_memory_agent_index(&self) -> ClawResult<()>
Create a B-tree index on active_memory(agent_id) if it does not
already exist.
§Errors
Returns a crate::error::ClawError if the SQL execution fails.
Sourcepub async fn ensure_session_index(&self) -> ClawResult<()>
pub async fn ensure_session_index(&self) -> ClawResult<()>
Create a B-tree index on session_state(session_id) if it does not
already exist.
§Errors
Returns a crate::error::ClawError if the SQL execution fails.
Sourcepub async fn ensure_tool_output_index(&self) -> ClawResult<()>
pub async fn ensure_tool_output_index(&self) -> ClawResult<()>
Create a B-tree index on tool_output(tool_name, created_at) if it
does not already exist.
§Errors
Returns a crate::error::ClawError if the SQL execution fails.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for IndexManager<'a>
impl<'a> !RefUnwindSafe for IndexManager<'a>
impl<'a> Send for IndexManager<'a>
impl<'a> Sync for IndexManager<'a>
impl<'a> Unpin for IndexManager<'a>
impl<'a> UnsafeUnpin for IndexManager<'a>
impl<'a> !UnwindSafe for IndexManager<'a>
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> 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