pub struct SqliteConversationStore { /* private fields */ }Implementations§
Source§impl SqliteConversationStore
impl SqliteConversationStore
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self, ConversationStoreError>
pub fn open(path: impl AsRef<Path>) -> Result<Self, ConversationStoreError>
Open (or create) a database and initialize conversation tables.
pub fn create( &self, owner: impl Into<String>, agent: impl Into<String>, ) -> Result<Conversation, ConversationStoreError>
pub fn active( &self, owner: &str, ) -> Result<Option<Conversation>, ConversationStoreError>
Sourcepub fn list(
&self,
owner: &str,
) -> Result<Vec<Conversation>, ConversationStoreError>
pub fn list( &self, owner: &str, ) -> Result<Vec<Conversation>, ConversationStoreError>
Lists non-archived conversations belonging to owner, newest activity first.
Sourcepub fn list_archived(
&self,
owner: &str,
) -> Result<Vec<Conversation>, ConversationStoreError>
pub fn list_archived( &self, owner: &str, ) -> Result<Vec<Conversation>, ConversationStoreError>
Lists archived conversations belonging to owner, newest activity first.
pub fn set_active( &self, owner: &str, id: ConversationId, ) -> Result<(), ConversationStoreError>
pub fn get( &self, id: ConversationId, ) -> Result<Conversation, ConversationStoreError>
pub fn rename( &self, owner: &str, id: ConversationId, title: impl Into<String>, ) -> Result<Conversation, ConversationStoreError>
pub fn set_selected_family( &self, owner: &str, id: ConversationId, family_id: Option<FamilyId>, ) -> Result<Conversation, ConversationStoreError>
Sourcepub fn set_archived(
&self,
owner: &str,
id: ConversationId,
archived: bool,
) -> Result<Conversation, ConversationStoreError>
pub fn set_archived( &self, owner: &str, id: ConversationId, archived: bool, ) -> Result<Conversation, ConversationStoreError>
Archives or restores a conversation belonging to owner.
Archiving also clears the active pointer when it refers to this conversation. The conversation and its message history remain intact.
pub fn delete( &self, owner: &str, id: ConversationId, ) -> Result<(), ConversationStoreError>
Sourcepub fn save_messages(
&self,
id: ConversationId,
messages: Vec<Message>,
) -> Result<Conversation, ConversationStoreError>
pub fn save_messages( &self, id: ConversationId, messages: Vec<Message>, ) -> Result<Conversation, ConversationStoreError>
Replaces the full message history. New execution paths should append messages incrementally through the message repository introduced later.
Sourcepub fn import_legacy(
&self,
legacy_root: impl AsRef<Path>,
) -> Result<LegacyImportReport, ConversationStoreError>
pub fn import_legacy( &self, legacy_root: impl AsRef<Path>, ) -> Result<LegacyImportReport, ConversationStoreError>
Import the legacy file store without changing or deleting its files.
Existing SQLite rows always win, making repeated or interrupted imports safe. Each conversation and its ordered messages are inserted atomically.