pub struct SqlEndpointConfig {Show 22 fields
pub db_url: String,
pub max_connections: Option<u32>,
pub min_connections: Option<u32>,
pub idle_timeout_secs: Option<u64>,
pub max_lifetime_secs: Option<u64>,
pub query: String,
pub source_path: Option<String>,
pub output_type: SqlOutputType,
pub placeholder: char,
pub noop: bool,
pub delay_ms: u64,
pub initial_delay_ms: u64,
pub max_messages_per_poll: Option<i32>,
pub on_consume: Option<String>,
pub on_consume_failed: Option<String>,
pub on_consume_batch_complete: Option<String>,
pub route_empty_result_set: bool,
pub use_iterator: bool,
pub expected_update_count: Option<i64>,
pub break_batch_on_consume_fail: bool,
pub batch: bool,
pub use_message_body_for_sql: bool,
}Expand description
Configuration for SQL component endpoints.
URI format: sql:<query>?db_url=<url>¶m1=val1¶m2=val2
The query can be inline SQL or a file reference with file: prefix:
sql:SELECT * FROM users?db_url=...- inline SQLsql:file:/path/to/query.sql?db_url=...- read SQL from file
Fields§
§db_url: StringDatabase connection URL (required).
max_connections: Option<u32>Maximum connections in the pool. None = use global default.
min_connections: Option<u32>Minimum connections in the pool. None = use global default.
idle_timeout_secs: Option<u64>Idle timeout in seconds. None = use global default.
max_lifetime_secs: Option<u64>Maximum connection lifetime in seconds. None = use global default.
query: StringThe SQL query (from URI path or file).
source_path: Option<String>Path to the file containing the SQL query (when using file: prefix).
output_type: SqlOutputTypeOutput type for query results. Default: SelectList.
placeholder: charPlaceholder character for parameters. Default: ‘#’.
noop: boolIf true, don’t execute the query (dry run). Default: false.
delay_ms: u64Delay between polls in milliseconds. Default: 500.
initial_delay_ms: u64Initial delay before first poll in milliseconds. Default: 1000.
max_messages_per_poll: Option<i32>Maximum messages per poll.
on_consume: Option<String>SQL to execute after consuming each message.
on_consume_failed: Option<String>SQL to execute if consumption fails.
on_consume_batch_complete: Option<String>SQL to execute after consuming a batch.
route_empty_result_set: boolRoute empty result sets. Default: false.
use_iterator: boolUse iterator for results. Default: true.
expected_update_count: Option<i64>Expected number of rows affected.
break_batch_on_consume_fail: boolBreak batch on consume failure. Default: false.
batch: boolEnable batch mode. Default: false.
use_message_body_for_sql: boolUse message body for SQL. Default: false.
Implementations§
Source§impl SqlEndpointConfig
impl SqlEndpointConfig
Sourcepub fn apply_defaults(&mut self, defaults: &SqlGlobalConfig)
pub fn apply_defaults(&mut self, defaults: &SqlGlobalConfig)
Apply defaults from global config, filling None fields without overriding.
Sourcepub fn resolve_defaults(&mut self)
pub fn resolve_defaults(&mut self)
Resolve any remaining None fields with built-in defaults.
Trait Implementations§
Source§impl Clone for SqlEndpointConfig
impl Clone for SqlEndpointConfig
Source§fn clone(&self) -> SqlEndpointConfig
fn clone(&self) -> SqlEndpointConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SqlEndpointConfig
impl Debug for SqlEndpointConfig
Source§impl UriConfig for SqlEndpointConfig
impl UriConfig for SqlEndpointConfig
Source§fn scheme() -> &'static str
fn scheme() -> &'static str
Source§fn from_uri(uri: &str) -> Result<Self, CamelError>
fn from_uri(uri: &str) -> Result<Self, CamelError>
Source§fn from_components(parts: UriComponents) -> Result<Self, CamelError>
fn from_components(parts: UriComponents) -> Result<Self, CamelError>
Source§fn validate(self) -> Result<Self, CamelError>
fn validate(self) -> Result<Self, CamelError>
Auto Trait Implementations§
impl Freeze for SqlEndpointConfig
impl RefUnwindSafe for SqlEndpointConfig
impl Send for SqlEndpointConfig
impl Sync for SqlEndpointConfig
impl Unpin for SqlEndpointConfig
impl UnsafeUnpin for SqlEndpointConfig
impl UnwindSafe for SqlEndpointConfig
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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