pub struct SqliteSourceConfig {
pub database_url: String,
pub query: String,
pub max_connections: u32,
pub batch_size: usize,
}Expand description
Configuration for the SQLite query source.
Fields§
§database_url: StringSQLite database URL (file path or sqlite::memory:).
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 SqliteSourceConfig
impl SqliteSourceConfig
Sourcepub fn new(database_url: impl Into<String>, query: impl Into<String>) -> Self
pub fn new(database_url: impl Into<String>, query: impl Into<String>) -> Self
Create a new config with the required database 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 SqliteSourceConfig
impl Clone for SqliteSourceConfig
Source§fn clone(&self) -> SqliteSourceConfig
fn clone(&self) -> SqliteSourceConfig
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 SqliteSourceConfig
impl Debug for SqliteSourceConfig
Source§impl<'de> Deserialize<'de> for SqliteSourceConfig
impl<'de> Deserialize<'de> for SqliteSourceConfig
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 SqliteSourceConfig
impl JsonSchema for SqliteSourceConfig
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 SqliteSourceConfig
impl RefUnwindSafe for SqliteSourceConfig
impl Send for SqliteSourceConfig
impl Sync for SqliteSourceConfig
impl Unpin for SqliteSourceConfig
impl UnsafeUnpin for SqliteSourceConfig
impl UnwindSafe for SqliteSourceConfig
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