pub struct Db { /* private fields */ }Implementations§
Source§impl Db
impl Db
pub fn open() -> Result<Self>
pub fn init(&self) -> Result<()>
pub fn create_conversation( &self, model: &str, provider: &str, cwd: &str, ) -> Result<String>
pub fn create_conversation_with_id( &self, id: &str, model: &str, provider: &str, cwd: &str, ) -> Result<()>
pub fn list_conversations( &self, limit: usize, ) -> Result<Vec<ConversationSummary>>
pub fn list_conversations_for_cwd( &self, cwd: &str, limit: usize, ) -> Result<Vec<ConversationSummary>>
pub fn get_conversation(&self, id: &str) -> Result<Conversation>
pub fn update_conversation_title(&self, id: &str, title: &str) -> Result<()>
pub fn delete_conversation(&self, id: &str) -> Result<()>
pub fn truncate_messages( &self, conversation_id: &str, keep: usize, ) -> Result<()>
pub fn add_message( &self, conversation_id: &str, role: &str, content: &str, ) -> Result<String>
pub fn get_messages(&self, conversation_id: &str) -> Result<Vec<DbMessage>>
pub fn update_last_input_tokens( &self, conversation_id: &str, tokens: u32, ) -> Result<()>
pub fn update_message_tokens(&self, id: &str, tokens: u32) -> Result<()>
pub fn add_tool_call( &self, message_id: &str, tool_id: &str, name: &str, input: &str, ) -> Result<()>
pub fn update_tool_result( &self, tool_id: &str, output: &str, is_error: bool, ) -> Result<()>
pub fn get_tool_calls(&self, message_id: &str) -> Result<Vec<DbToolCall>>
pub fn get_user_message_history(&self, limit: usize) -> Result<Vec<String>>
pub fn create_task( &self, id: &str, prompt: &str, pid: u32, cwd: &str, ) -> Result<()>
pub fn complete_task( &self, id: &str, status: &str, session_id: Option<&str>, output: &str, ) -> Result<()>
pub fn list_tasks(&self, limit: usize) -> Result<Vec<TaskRecord>>
pub fn get_task(&self, id: &str) -> Result<TaskRecord>
Auto Trait Implementations§
impl !Freeze for Db
impl !RefUnwindSafe for Db
impl Send for Db
impl !Sync for Db
impl Unpin for Db
impl UnsafeUnpin for Db
impl !UnwindSafe for Db
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