Skip to main content

agent_sdk_store_postgres/
bundle.rs

1use crate::{
2    PostgresAgentPoolStore, PostgresCheckpointStore, PostgresContentStore, PostgresEventArchive,
3    PostgresProviderArgumentStore, PostgresRunJournal, PostgresStoreClient,
4    PostgresToolExecutionStore,
5};
6
7#[derive(Clone)]
8/// Postgres-style store bundle sharing one client.
9pub struct PostgresStoreBundle {
10    client: PostgresStoreClient,
11}
12
13impl PostgresStoreBundle {
14    /// Creates a store bundle over a host-owned SQL transport.
15    pub fn new(client: PostgresStoreClient) -> Self {
16        Self { client }
17    }
18
19    pub fn journal(&self) -> PostgresRunJournal {
20        PostgresRunJournal::new(self.client.clone())
21    }
22
23    pub fn checkpoints(&self) -> PostgresCheckpointStore {
24        PostgresCheckpointStore::new(self.client.clone())
25    }
26
27    pub fn content(&self) -> PostgresContentStore {
28        PostgresContentStore::new(self.client.clone())
29    }
30
31    pub fn event_archive(&self) -> PostgresEventArchive {
32        PostgresEventArchive::new(self.client.clone())
33    }
34
35    pub fn agent_pool(&self) -> PostgresAgentPoolStore {
36        PostgresAgentPoolStore::new(self.client.clone())
37    }
38
39    pub fn tool_execution(&self) -> PostgresToolExecutionStore {
40        PostgresToolExecutionStore::new(self.client.clone())
41    }
42
43    pub fn provider_arguments(&self) -> PostgresProviderArgumentStore {
44        PostgresProviderArgumentStore::new(self.client.clone())
45    }
46}