pub struct WriteSpec {
pub write_mode: WriteMode,
pub key: Vec<String>,
pub delete_marker: Option<DeleteMarker>,
}Expand description
Shared write-mode config, embedded in each upsert-capable sink config via
#[serde(flatten)] so write_mode / key / delete_marker appear at the
sink-config top level.
Fields§
§write_mode: WriteModeAppend (default), upsert, or delete.
key: Vec<String>Key columns. Required and non-empty for upsert/delete; ignored for append.
delete_marker: Option<DeleteMarker>Optional. Upsert only: rows whose field matches one of values are
deletes; all others are upserts. The marker field is stripped from
upsert rows before writing.
Implementations§
Source§impl WriteSpec
impl WriteSpec
Sourcepub fn validate(&self) -> Result<(), FaucetError>
pub fn validate(&self) -> Result<(), FaucetError>
Validate internal consistency at config-load time.
Sourcepub fn dedups_by_key(&self) -> bool
pub fn dedups_by_key(&self) -> bool
Whether this spec makes writes converge by key — write_mode: upsert
or delete with a non-empty key. The canonical implementation of
Sink::dedups_by_key for sinks that
flatten a WriteSpec into their config.
Sourcepub fn is_overwrite(&self) -> bool
pub fn is_overwrite(&self) -> bool
Whether this spec requests full-destination replacement
(WriteMode::Overwrite). The canonical implementation of
Sink::is_overwrite for sinks that flatten
a WriteSpec into their config.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WriteSpec
impl<'de> Deserialize<'de> for WriteSpec
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 WriteSpec
impl JsonSchema for WriteSpec
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 moreAuto Trait Implementations§
impl Freeze for WriteSpec
impl RefUnwindSafe for WriteSpec
impl Send for WriteSpec
impl Sync for WriteSpec
impl Unpin for WriteSpec
impl UnsafeUnpin for WriteSpec
impl UnwindSafe for WriteSpec
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
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§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