pub struct PostgresEventStore { /* private fields */ }Implementations§
Source§impl PostgresEventStore
impl PostgresEventStore
Sourcepub async fn new<S: Into<String>>(
connection_string: S,
) -> Result<Self, PostgresEventStoreError>
pub async fn new<S: Into<String>>( connection_string: S, ) -> Result<Self, PostgresEventStoreError>
Create a new PostgresEventStore with default configuration.
Sourcepub async fn with_config<S: Into<String>>(
connection_string: S,
config: PostgresConfig,
) -> Result<Self, PostgresEventStoreError>
pub async fn with_config<S: Into<String>>( connection_string: S, config: PostgresConfig, ) -> Result<Self, PostgresEventStoreError>
Create a new PostgresEventStore with custom configuration.
Sourcepub fn from_pool(pool: Pool<Postgres>) -> Self
pub fn from_pool(pool: Pool<Postgres>) -> Self
Create a PostgresEventStore from an existing connection pool.
Use this when you need full control over pool configuration or want to share a pool across multiple components.
pub async fn ping(&self)
pub async fn migrate(&self)
Trait Implementations§
Source§impl Clone for PostgresEventStore
impl Clone for PostgresEventStore
Source§fn clone(&self) -> PostgresEventStore
fn clone(&self) -> PostgresEventStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PostgresEventStore
impl Debug for PostgresEventStore
Source§impl EventReader for PostgresEventStore
impl EventReader for PostgresEventStore
Source§type Error = EventStoreError
type Error = EventStoreError
Error type returned by read operations.
Source§async fn read_events<E: Event>(
&self,
filter: EventFilter,
page: EventPage,
) -> Result<Vec<(E, StreamPosition)>, Self::Error>
async fn read_events<E: Event>( &self, filter: EventFilter, page: EventPage, ) -> Result<Vec<(E, StreamPosition)>, Self::Error>
Read events matching filter criteria with pagination. Read more
Source§impl EventStore for PostgresEventStore
impl EventStore for PostgresEventStore
Source§async fn read_stream<E: Event>(
&self,
stream_id: StreamId,
) -> Result<EventStreamReader<E>, EventStoreError>
async fn read_stream<E: Event>( &self, stream_id: StreamId, ) -> Result<EventStreamReader<E>, EventStoreError>
Read all events from a stream. Read more
Source§async fn append_events(
&self,
writes: StreamWrites,
) -> Result<EventStreamSlice, EventStoreError>
async fn append_events( &self, writes: StreamWrites, ) -> Result<EventStreamSlice, EventStoreError>
Atomically append events to multiple streams with optimistic concurrency control. Read more
Auto Trait Implementations§
impl Freeze for PostgresEventStore
impl !RefUnwindSafe for PostgresEventStore
impl Send for PostgresEventStore
impl Sync for PostgresEventStore
impl Unpin for PostgresEventStore
impl !UnwindSafe for PostgresEventStore
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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