pub struct DuckdbSourceConfig {
pub database: String,
pub query: String,
pub read_only: bool,
pub batch_size: usize,
}Expand description
Configuration for the DuckDB query source.
Fields§
§database: StringPath to the DuckDB database file, or :memory: for an in-memory
database. A duckdb:// / duckdb: scheme prefix is accepted and
stripped.
query: StringSQL query to execute.
read_only: boolOpen the database read-only. Defaults to false (read-write).
Set true to attach to a database file another process holds open —
DuckDB permits multiple read-only connections to one file but only a
single read-write connection.
batch_size: usizeRecords per emitted StreamPage. Rows are
drained from the DuckDB result and yielded whenever the buffer reaches
this size. Defaults to DEFAULT_BATCH_SIZE.
batch_size = 0 is the “no batching” sentinel: the entire result set is
emitted in a single page. Useful for small lookup tables.
Implementations§
Source§impl DuckdbSourceConfig
impl DuckdbSourceConfig
Sourcepub fn new(database: impl Into<String>, query: impl Into<String>) -> Self
pub fn new(database: impl Into<String>, query: impl Into<String>) -> Self
Create a new config with the required database path and query.
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 DuckdbSourceConfig
impl Clone for DuckdbSourceConfig
Source§fn clone(&self) -> DuckdbSourceConfig
fn clone(&self) -> DuckdbSourceConfig
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 DuckdbSourceConfig
impl Debug for DuckdbSourceConfig
Source§impl<'de> Deserialize<'de> for DuckdbSourceConfig
impl<'de> Deserialize<'de> for DuckdbSourceConfig
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 DuckdbSourceConfig
impl JsonSchema for DuckdbSourceConfig
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