pub struct PgDocumentBuilder { /* private fields */ }Expand description
Builds index documents from a Postgres database, driven by a SourceSpec —
the enabled indexes and their schemas, translated from the top-level config
by the composition root. Cheap to clone — the pool, spec, and primary-key
cache are shared.
Implementations§
Trait Implementations§
Source§impl Catalog for PgDocumentBuilder
The Postgres source’s view of its own catalog. The index mapping is derived
from the self-describing schema in schema_core; this is the one
store-specific piece used for validation — how Postgres types and
constrains a column — so a declared schema can be checked against the live
database.
impl Catalog for PgDocumentBuilder
The Postgres source’s view of its own catalog. The index mapping is derived
from the self-describing schema in schema_core; this is the one
store-specific piece used for validation — how Postgres types and
constrains a column — so a declared schema can be checked against the live
database.
Source§fn column<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
schema: &'life1 DatabaseSchema,
table: &'life2 TableName,
column: &'life3 ColumnName,
) -> Pin<Box<dyn Future<Output = Result<ColumnInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn column<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
schema: &'life1 DatabaseSchema,
table: &'life2 TableName,
column: &'life3 ColumnName,
) -> Pin<Box<dyn Future<Output = Result<ColumnInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
The type and nullability of
column in table (within schema), as the
store defines it.Source§impl Clone for PgDocumentBuilder
impl Clone for PgDocumentBuilder
Source§fn clone(&self) -> PgDocumentBuilder
fn clone(&self) -> PgDocumentBuilder
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 PgDocumentBuilder
impl Debug for PgDocumentBuilder
Source§impl DocumentBuilder for PgDocumentBuilder
impl DocumentBuilder for PgDocumentBuilder
Source§fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
table: &'life1 TableName,
key: &'life2 RowKey,
) -> Pin<Box<dyn Future<Output = Result<Vec<DocumentId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
table: &'life1 TableName,
key: &'life2 RowKey,
) -> Pin<Box<dyn Future<Output = Result<Vec<DocumentId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
The documents the changed row affects. Empty if it touches nothing any
index cares about.
Source§fn build<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DocumentId,
) -> Pin<Box<dyn Future<Output = Result<Document>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn build<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DocumentId,
) -> Pin<Box<dyn Future<Output = Result<Document>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Assemble one document, or report it deleted if its root row is absent.
Source§fn build_many<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [DocumentId],
) -> Pin<Box<dyn Future<Output = Result<Vec<Document>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn build_many<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [DocumentId],
) -> Pin<Box<dyn Future<Output = Result<Vec<Document>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Assemble many documents at once. Returns one
Document per requested
id — an Upsert, or a Delete tombstone when the root row is absent —
in any order; callers match results back by Document::id. Read moreSource§fn backfill_scopes(&self) -> Vec<IndexScope>
fn backfill_scopes(&self) -> Vec<IndexScope>
The enabled indexes this builder serves, each with the root table to
snapshot when seeding it. The engine uses this to scope an initial
backfill per index. The default is empty — a builder with no backfillable
indexes, which the engine simply never seeds.
Source§fn index_mappings<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<IndexMapping>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn index_mappings<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<IndexMapping>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The resolved mapping of every index this builder serves: each field
typed from the schema’s explicit
mapping where one is given, and from
the source’s own column types otherwise. Sinks that own their index use
this to create it up front. The default is empty — a builder that leaves
index creation to whatever the sink does on first write.Auto Trait Implementations§
impl !RefUnwindSafe for PgDocumentBuilder
impl !UnwindSafe for PgDocumentBuilder
impl Freeze for PgDocumentBuilder
impl Send for PgDocumentBuilder
impl Sync for PgDocumentBuilder
impl Unpin for PgDocumentBuilder
impl UnsafeUnpin for PgDocumentBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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