pub struct MysqlSourceConfig {
pub connection_url: String,
pub query: String,
pub max_connections: u32,
pub batch_size: usize,
}Expand description
Configuration for the MySQL query source.
Fields§
§connection_url: StringMySQL connection URL (e.g. mysql://user:pass@host/db).
query: StringSQL query to execute.
max_connections: u32Maximum number of connections in the pool. Defaults to 10.
batch_size: usizeRecords per emitted StreamPage. Rows are
drained from the sqlx cursor and yielded whenever the buffer reaches
this size. Defaults to DEFAULT_BATCH_SIZE.
batch_size = 0 is the “no batching” sentinel: the cursor is fully
drained and the entire result set is emitted in a single page. Useful
for small lookup tables or for sinks (e.g. SQL COPY, BigQuery load
jobs) that prefer one large request to many small ones.
Implementations§
Source§impl MysqlSourceConfig
impl MysqlSourceConfig
Sourcepub fn new(connection_url: impl Into<String>, query: impl Into<String>) -> Self
pub fn new(connection_url: impl Into<String>, query: impl Into<String>) -> Self
Create a new config with the required connection URL and query.
Sourcepub fn with_max_connections(self, max_connections: u32) -> Self
pub fn with_max_connections(self, max_connections: u32) -> Self
Set the maximum number of connections in the pool.
Sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
Set the per-page row count for Source::stream_pages.
Pass 0 to opt out of batching — the entire result set is emitted in
a single StreamPage.
Trait Implementations§
Source§impl Clone for MysqlSourceConfig
impl Clone for MysqlSourceConfig
Source§fn clone(&self) -> MysqlSourceConfig
fn clone(&self) -> MysqlSourceConfig
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 MysqlSourceConfig
impl Debug for MysqlSourceConfig
Source§impl<'de> Deserialize<'de> for MysqlSourceConfig
impl<'de> Deserialize<'de> for MysqlSourceConfig
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 MysqlSourceConfig
impl JsonSchema for MysqlSourceConfig
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 MysqlSourceConfig
impl RefUnwindSafe for MysqlSourceConfig
impl Send for MysqlSourceConfig
impl Sync for MysqlSourceConfig
impl Unpin for MysqlSourceConfig
impl UnsafeUnpin for MysqlSourceConfig
impl UnwindSafe for MysqlSourceConfig
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,
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 more