pub struct PostgresProjectionSource { /* private fields */ }Expand description
PostgreSQL implementation of the strict, lossless projection delivery source.
Implementations§
Source§impl PostgresProjectionSource
impl PostgresProjectionSource
Sourcepub async fn new<S: Into<String>>(
connection_string: S,
source_id: DeliverySourceId,
) -> Result<Self, PostgresProjectionSourceError>
pub async fn new<S: Into<String>>( connection_string: S, source_id: DeliverySourceId, ) -> Result<Self, PostgresProjectionSourceError>
Creates a source with the default PostgreSQL pool configuration.
Sourcepub async fn with_config<S: Into<String>>(
connection_string: S,
config: PostgresConfig,
source_id: DeliverySourceId,
) -> Result<Self, PostgresProjectionSourceError>
pub async fn with_config<S: Into<String>>( connection_string: S, config: PostgresConfig, source_id: DeliverySourceId, ) -> Result<Self, PostgresProjectionSourceError>
Creates a source with an explicit PostgreSQL pool configuration.
Sourcepub fn from_pool(pool: Pool<Postgres>, source_id: DeliverySourceId) -> Self
pub fn from_pool(pool: Pool<Postgres>, source_id: DeliverySourceId) -> Self
Creates a source from an existing pool and a stable application-supplied source identity.
Sourcepub async fn migrate(&self) -> Result<(), PostgresProjectionSourceError>
pub async fn migrate(&self) -> Result<(), PostgresProjectionSourceError>
Applies the source-owned delivery migration without using SQLx’s shared migration ledger.
Trait Implementations§
Source§impl Clone for PostgresProjectionSource
impl Clone for PostgresProjectionSource
Source§fn clone(&self) -> PostgresProjectionSource
fn clone(&self) -> PostgresProjectionSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PostgresProjectionSource
impl Debug for PostgresProjectionSource
Source§impl ProjectionSource for PostgresProjectionSource
impl ProjectionSource for PostgresProjectionSource
Source§type Error = PostgresProjectionSourceError
type Error = PostgresProjectionSourceError
Error returned when the source cannot read its committed delivery sequence.
Source§fn source_id(&self) -> &DeliverySourceId
fn source_id(&self) -> &DeliverySourceId
Returns this source’s stable delivery identity. Read more
Source§async fn high_watermark(&self) -> Result<Option<DeliveryPosition>, Self::Error>
async fn high_watermark(&self) -> Result<Option<DeliveryPosition>, Self::Error>
Returns the committed high-water mark for the entire delivery sequence. Read more
Source§async fn read_envelopes(
&self,
selection: &ProjectionSelection,
after: Option<DeliveryPosition>,
through: DeliveryUpperBound,
limit: BatchSize,
) -> Result<Vec<PersistedEventEnvelope>, Self::Error>
async fn read_envelopes( &self, selection: &ProjectionSelection, after: Option<DeliveryPosition>, through: DeliveryUpperBound, limit: BatchSize, ) -> Result<Vec<PersistedEventEnvelope>, Self::Error>
Reads one selected page in ascending delivery order. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PostgresProjectionSource
impl !UnwindSafe for PostgresProjectionSource
impl Freeze for PostgresProjectionSource
impl Send for PostgresProjectionSource
impl Sync for PostgresProjectionSource
impl Unpin for PostgresProjectionSource
impl UnsafeUnpin for PostgresProjectionSource
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