risingwave_connector/source/cdc/
mariadb.rs1use std::collections::BTreeMap;
16
17use risingwave_pb::secret::PbSecretRef;
18
19use crate::error::ConnectorResult;
20use crate::source::cdc::{
21 CdcSourceDdlValidator, CdcSourceExternalTableIdentifier, CdcSourceRuntimeFlags,
22 CdcSourceTypeTrait, Mariadb, Mysql, check_alter_with_options_inner, check_common_with_options,
23};
24
25impl CdcSourceRuntimeFlags for Mariadb {
28 const CAN_AUTO_SCHEMA_CHANGE: bool = true;
29 const CAN_BACKFILL: bool = true;
30 const CAN_USE_TRANSACTION_METADATA: bool = true;
31 const NEEDS_NON_EMPTY_INITIAL_OFFSET: bool = true;
32}
33
34impl CdcSourceDdlValidator for Mariadb {
37 fn check_and_fill_create_with_options(
38 props: &mut BTreeMap<String, String>,
39 secret_refs: &BTreeMap<String, PbSecretRef>,
40 ) -> ConnectorResult<()> {
41 Mysql::check_and_fill_create_with_options(props, secret_refs)
43 }
44
45 fn check_alter_with_options(
46 props: &BTreeMap<String, String>,
47 secret_refs: &BTreeMap<String, PbSecretRef>,
48 ) -> ConnectorResult<()> {
49 check_common_with_options::<Self>(props, secret_refs)?;
50 check_alter_with_options_inner(
51 Self::CDC_CONNECTOR_NAME,
52 props,
53 secret_refs,
54 &[
55 "cdc.source.wait.streaming.start.timeout",
56 "debezium.max.queue.size",
57 "debezium.queue.memory.ratio",
58 "hostname",
59 "port",
60 "password",
61 ],
62 )
63 }
64}
65
66impl CdcSourceExternalTableIdentifier for Mariadb {}