Skip to main content

purify_source_exports

Function purify_source_exports 

Source
pub(super) async fn purify_source_exports(
    client: &Client,
    retrieved_references: &RetrievedSourceReferences,
    requested_references: &Option<ExternalReferences>,
    text_columns: Vec<UnresolvedItemName>,
    exclude_columns: Vec<UnresolvedItemName>,
    exclude_constraints: &BTreeSet<String>,
    exclude_all_constraints: bool,
    unresolved_source_name: &UnresolvedItemName,
    reference_policy: &SourceReferencePolicy,
    initial_lsn: MzOffset,
) -> Result<PurifiedSourceExports, PlanError>
Expand description

Purifies the requested external references, returning the purified source exports that correspond to external tables along with the additional fields needed to generate the relevant statements and update statement options.

initial_lsn is an upper bound on the upstream LSN whose schemas retrieved_references describe, and the point from which the purified exports interpret the replication stream. It must be read after retrieved_references, so that it accounts for any schema change they already reflect. Reading it earlier leaves a window in which replication trusts a Relation message describing a schema older than the one captured here.

exclude_constraints and exclude_all_constraints are only ever non-empty or true for CREATE TABLE .. FROM SOURCE, which purifies exactly one export, so constraint names are validated against that single table’s constraints.