pub enum SpannerReplication {
Full,
Incremental {
column: String,
initial_value: Value,
},
}Expand description
How the source replicates rows across runs.
Serializes as { type: full } or
{ type: incremental, column: "...", initial_value: ... }.
Variants§
Full
Every run fetches the full result set (default).
Incremental
Only rows not yet read, in column order, resuming from the stored
bookmark (or initial_value on the first run).
The source wraps the query as
SELECT * FROM (<query>) AS q WHERE q.`column` >= CAST(@bookmark AS <type>) ORDER BY q.`column`
(<type> is the column’s type, read from the query’s result metadata)
and drops the rows it already emitted at the bookmark value, so rows
that share a cursor value (ties, late commits) are never skipped.
Every page carries a bookmark, so a crash replays at most one page.
Write @bookmark in the query (with >=) to apply the cursor further
inside it; a strict > is refused. Rows whose column is NULL are
never read.
@bookmark inside the query is bound by its JSON type (a timestamp
bookmark is a STRING), and Spanner does not coerce parameter types: cast
it where you use it, e.g. WHERE updated_at >= TIMESTAMP(@bookmark).
Trait Implementations§
Source§impl Clone for SpannerReplication
impl Clone for SpannerReplication
Source§impl Debug for SpannerReplication
impl Debug for SpannerReplication
Source§impl Default for SpannerReplication
impl Default for SpannerReplication
Source§impl<'de> Deserialize<'de> for SpannerReplication
impl<'de> Deserialize<'de> for SpannerReplication
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SpannerReplication
impl JsonSchema for SpannerReplication
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for SpannerReplication
impl PartialEq for SpannerReplication
Source§impl Serialize for SpannerReplication
impl Serialize for SpannerReplication
impl StructuralPartialEq for SpannerReplication
Auto Trait Implementations§
impl Forget for SpannerReplication
impl Freeze for SpannerReplication
impl Move for SpannerReplication
impl RefUnwindSafe for SpannerReplication
impl Send for SpannerReplication
impl Sync for SpannerReplication
impl Unpin for SpannerReplication
impl UnsafeUnpin for SpannerReplication
impl UnwindSafe for SpannerReplication
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request