pub struct PostgresStorage { /* private fields */ }Implementations§
Source§impl PostgresStorage
impl PostgresStorage
pub fn new(db_url: String) -> Result<Self, Whatever>
pub async fn client(&self) -> Result<Object, Whatever>
pub async fn statement( &self, client: &Object, query: &str, ) -> Result<Statement, Whatever>
pub async fn query( &self, client: &Object, stmt: &Statement, params: &[&(dyn ToSql + Sync)], ) -> Result<Vec<Row>, Whatever>
Trait Implementations§
Source§impl FeedStorage for PostgresStorage
impl FeedStorage for PostgresStorage
Source§async fn insert_timeline_entry(
&mut self,
entry: &TimelineEntry,
) -> Result<(), Self::Error>
async fn insert_timeline_entry( &mut self, entry: &TimelineEntry, ) -> Result<(), Self::Error>
Inserts a new timeline entry into the database, in case of conflict it tries to update the last operation ID.
type Error = Whatever
Source§async fn get_last_processed_operation(
&self,
rid: &RepoId,
cob_id: &ObjectId,
typename: &TypeName,
) -> Result<Option<Oid>, Self::Error>
async fn get_last_processed_operation( &self, rid: &RepoId, cob_id: &ObjectId, typename: &TypeName, ) -> Result<Option<Oid>, Self::Error>
Get the last processed operation ID for a specific repository and COB (Collaborative Object)
Source§async fn operation_exists(
&self,
operation_id: &Oid,
) -> Result<bool, Self::Error>
async fn operation_exists( &self, operation_id: &Oid, ) -> Result<bool, Self::Error>
Check if an operation already exists in storage (for duplicate prevention)
Source§async fn insert_batch(
&mut self,
entries: &[OperationEntry],
) -> Result<(), Self::Error>
async fn insert_batch( &mut self, entries: &[OperationEntry], ) -> Result<(), Self::Error>
Insert a batch of operations entries into storage
Auto Trait Implementations§
impl Freeze for PostgresStorage
impl !RefUnwindSafe for PostgresStorage
impl Send for PostgresStorage
impl Sync for PostgresStorage
impl Unpin for PostgresStorage
impl !UnwindSafe for PostgresStorage
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