pub struct ExportRequest<'a> {
pub query: &'a str,
pub catalog_hint_query: Option<&'a str>,
pub incremental: Option<&'a IncrementalCursorPlan>,
pub cursor: Option<&'a CursorState>,
pub tuning: &'a SourceTuning,
pub column_overrides: &'a ColumnOverrides,
pub page_limit: Option<usize>,
}Expand description
Read-only inputs for a single export call.
Packs the parameters that used to live as 5 positional args on
Source::export into a named struct. sink is not part of this struct
— it is &mut and conceptually the output channel, separate from the
read-only request configuration.
Fields§
§query: &'a strAlready-materialized SQL (after resolve_query). The driver still wraps
it with the dialect-specific incremental predicate via
[crate::source::query::build_incremental_query] when incremental is set.
catalog_hint_query: Option<&'a str>The unwrapped base query to resolve catalog-dependent type hints from
(PostgreSQL NUMERIC precision/scale, which the wire protocol omits — the
driver parses the FROM clause and asks pg_catalog). Chunked, dense and
keyset runners wrap query in a SELECT … FROM (<base>) … subquery that
hides the source table from the catalog parser, so they pass the original
base query here. None ⇒ resolve from query (full/incremental, where it
is already the unwrapped form). Drivers that read precision from the wire
(MySQL) ignore this field.
incremental: Option<&'a IncrementalCursorPlan>§cursor: Option<&'a CursorState>§tuning: &'a SourceTuning§column_overrides: &'a ColumnOverridesPer-column type declarations from rivet.yaml (exports[].columns:).
Drivers apply them during schema building so e.g. a NUMERIC column
without declared precision can still be exported as Decimal128(18,2)
when the user has stated the type explicitly.
page_limit: Option<usize>Keyset (seek) pagination page size (OPT-4). When Some(n) and
incremental carries the key plan, the driver builds one keyset page
(WHERE key > cursor ORDER BY key LIMIT n) instead of the unbounded
incremental/snapshot query. The keyset runner drives the outer loop.
Implementations§
Source§impl<'a> ExportRequest<'a>
impl<'a> ExportRequest<'a>
Sourcepub fn unwrapped(
query: &'a str,
tuning: &'a SourceTuning,
column_overrides: &'a ColumnOverrides,
) -> Self
pub fn unwrapped( query: &'a str, tuning: &'a SourceTuning, column_overrides: &'a ColumnOverrides, ) -> Self
A request whose query is already the unwrapped base form, so
catalog type hints resolve directly from it. Use for snapshot,
incremental and keyset runners: the driver applies any incremental /
keyset predicate internally, so the source table stays visible to the
catalog parser and catalog_hint_query is None.
Sourcepub fn wrapped(
query: &'a str,
base: &'a str,
tuning: &'a SourceTuning,
column_overrides: &'a ColumnOverrides,
) -> Self
pub fn wrapped( query: &'a str, base: &'a str, tuning: &'a SourceTuning, column_overrides: &'a ColumnOverrides, ) -> Self
A request whose query is a SELECT … FROM (<base>) … wrapper that
hides the source table (chunked / dense / time-window). base — the
unwrapped query catalog hints resolve from — is a required argument, so a
wrapping runner cannot silently fall back to the table-hiding wrapper and
lose PG NUMERIC precision (the bug the catalog-hint fix / ADR-0020
closed). Drivers that read precision from the wire (MySQL) ignore it.
Sourcepub fn with_incremental(self, plan: Option<&'a IncrementalCursorPlan>) -> Self
pub fn with_incremental(self, plan: Option<&'a IncrementalCursorPlan>) -> Self
Attach the incremental cursor plan (the driver builds the WHERE cursor > ? ORDER BY predicate). Pass-through Option so mode-polymorphic callers
can forward strategy.incremental_plan() directly.
Sourcepub fn with_cursor(self, cursor: Option<&'a CursorState>) -> Self
pub fn with_cursor(self, cursor: Option<&'a CursorState>) -> Self
Attach the last committed cursor value the next run resumes after.
Sourcepub fn with_page_limit(self, page_limit: usize) -> Self
pub fn with_page_limit(self, page_limit: usize) -> Self
Set the keyset (seek) page size — one bounded … WHERE key > cursor ORDER BY key LIMIT n page instead of the unbounded query.
Auto Trait Implementations§
impl<'a> Freeze for ExportRequest<'a>
impl<'a> RefUnwindSafe for ExportRequest<'a>
impl<'a> Send for ExportRequest<'a>
impl<'a> Sync for ExportRequest<'a>
impl<'a> Unpin for ExportRequest<'a>
impl<'a> UnsafeUnpin for ExportRequest<'a>
impl<'a> UnwindSafe for ExportRequest<'a>
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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>
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.