pub struct ClickHouseSourceConfig {
pub connection: ClickHouseConnection,
pub query: String,
pub batch_size: usize,
pub replication: ClickHouseReplication,
pub state_key: Option<String>,
}Expand description
Configuration for ClickHouseSource.
Fields§
§connection: ClickHouseConnectionConnection settings (url or host, database, credentials).
query: StringSQL SELECT query to run. The output format is set to JSONEachRow
via the request settings, so do not append a FORMAT clause. Use
the literal @bookmark token to push the incremental cursor down into
the WHERE clause; use {key} tokens to inject parent-context values in
a matrix child.
batch_size: usizeRecords per emitted StreamPage. 0 emits
the whole result set as a single page. Defaults to
DEFAULT_BATCH_SIZE.
replication: ClickHouseReplicationReplication mode. Defaults to ClickHouseReplication::Full.
state_key: Option<String>Explicit state-store key for the bookmark. When unset, a key is derived from the connection host and a query fingerprint.
Implementations§
Source§impl ClickHouseSourceConfig
impl ClickHouseSourceConfig
Sourcepub fn new(url: impl Into<String>, query: impl Into<String>) -> Self
pub fn new(url: impl Into<String>, query: impl Into<String>) -> Self
Build a config from a base URL and query, with defaults elsewhere.
Sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
Set the per-page record count.
Sourcepub fn incremental(self, column: impl Into<String>, initial: Value) -> Self
pub fn incremental(self, column: impl Into<String>, initial: Value) -> Self
Configure incremental replication on column, starting at initial.
Sourcepub fn validate(&self) -> Result<(), FaucetError>
pub fn validate(&self) -> Result<(), FaucetError>
Validate connection, batch size, and replication settings.
Trait Implementations§
Source§impl Clone for ClickHouseSourceConfig
impl Clone for ClickHouseSourceConfig
Source§fn clone(&self) -> ClickHouseSourceConfig
fn clone(&self) -> ClickHouseSourceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClickHouseSourceConfig
impl Debug for ClickHouseSourceConfig
Source§impl<'de> Deserialize<'de> for ClickHouseSourceConfig
impl<'de> Deserialize<'de> for ClickHouseSourceConfig
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 ClickHouseSourceConfig
impl JsonSchema for ClickHouseSourceConfig
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 more