pub struct PostgresBucket { /* private fields */ }
Implementations§
Source§impl PostgresBucket
impl PostgresBucket
pub fn event_table(&self) -> String
Sourcepub async fn rebuild_columns_cache(&self, client: &mut Client) -> Result<()>
pub async fn rebuild_columns_cache(&self, client: &mut Client) -> Result<()>
Rebuild the cache of columns in the table.
pub fn existing_columns(&self) -> Vec<String>
pub fn column(&self, column_name: &String) -> Option<PostgresColumn>
pub fn has_column(&self, column_name: &String) -> bool
pub async fn create_event_table(&self, client: &mut Client) -> Result<()>
pub async fn create_state_table(&self, client: &mut Client) -> Result<()>
pub async fn add_missing_columns( &self, client: &mut Client, missing: Vec<(String, &'static str)>, ) -> Result<()>
Trait Implementations§
Source§impl StorageCollection for PostgresBucket
impl StorageCollection for PostgresBucket
Source§fn add_event<'life0, 'life1, 'async_trait>(
&'life0 self,
entity_event: &'life1 Event,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_event<'life0, 'life1, 'async_trait>(
&'life0 self,
entity_event: &'life1 Event,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Postgres Event Table:
{bucket_name}_event
event_id uuid, // ID
/ULID
entity_id uuid, // ID
/ULID
operations bytea, // Vec<Operation>
clock bytea, // Clock
fn set_state<'life0, 'life1, 'async_trait>(
&'life0 self,
id: ID,
state: &'life1 State,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_state<'life0, 'async_trait>(
&'life0 self,
id: ID,
) -> Pin<Box<dyn Future<Output = Result<State, RetrievalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_states<'life0, 'life1, 'async_trait>(
&'life0 self,
predicate: &'life1 Predicate,
) -> Pin<Box<dyn Future<Output = Result<Vec<(ID, State)>, RetrievalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_events<'life0, 'async_trait>(
&'life0 self,
entity_id: ID,
) -> Pin<Box<dyn Future<Output = Result<Vec<Event>, RetrievalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_states<'life0, 'life1, 'async_trait>(
&'life0 self,
entities: Vec<(ID, &'life1 State)>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl Freeze for PostgresBucket
impl !RefUnwindSafe for PostgresBucket
impl Send for PostgresBucket
impl Sync for PostgresBucket
impl Unpin for PostgresBucket
impl !UnwindSafe for PostgresBucket
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