Class SqlBuilder
Fluent builder for SQL endpoint URIs. Thin sugar over .
Call or use implicit conversion to
to get the URI for From() / To().
public sealed class SqlBuilder
Inheritance
Methods
BackslashEscapes()
Reads a backslash inside '…' and "…" as an escape, as MySQL and MariaDB do by default — see
public SqlBuilder BackslashEscapes()
Batch(IExpression)
Sets the batch size from an expression. Only constant expressions and {{property}} placeholders are accepted:
public SqlBuilder Batch(IExpression size)
Batch(int)
Enables batch mode for producer mode: a list body is written item by item in one transaction.
public SqlBuilder Batch(int size)
BreakBatchOnError()
Stops the batch on the first error and rolls it back (the default).
public SqlBuilder BreakBatchOnError()
BreakBatchOnError(bool)
Chooses what a failing batch item does: true stops and rolls the batch back (the default); false undoes
public SqlBuilder BreakBatchOnError(bool enabled)
CommandTimeout(IExpression)
Sets the command timeout from an expression.
public SqlBuilder CommandTimeout(IExpression seconds)
CommandTimeout(int)
Sets the command timeout in seconds.
public SqlBuilder CommandTimeout(int seconds)
ConnectionString(IExpression)
Sets a direct connection string from a constant expression; a ${...} expression is refused, as for .
public SqlBuilder ConnectionString(IExpression cs)
ConnectionString(string)
Sets a direct connection string.
public SqlBuilder ConnectionString(string cs)
DataSource(IExpression)
Sets the named data source from a constant expression. The data source is fixed when the endpoint is created: a
public SqlBuilder DataSource(IExpression name)
DataSource(string)
Sets the named data source (constant name, e.g. "main").
public SqlBuilder DataSource(string name)
In(string, DbType, string)
Adds an IN parameter with an expression value.
public SqlBuilder In(string name, DbType type, string expression)
InitialDelay(IExpression)
Sets the initial delay from an expression.
public SqlBuilder InitialDelay(IExpression ms)
InitialDelay(int)
Sets the initial delay before the first poll.
public SqlBuilder InitialDelay(int ms)
InOut(string, DbType)
Adds an INOUT parameter definition.
public SqlBuilder InOut(string name, DbType type)
MaxMessagesPerPoll(IExpression)
Sets max messages per poll from an expression.
public SqlBuilder MaxMessagesPerPoll(IExpression max)
OnBatchComplete(string)
SQL to execute after the entire batch.
public SqlBuilder OnBatchComplete(string sql)
OnSuccess(string)
SQL to execute after each row is successfully processed.
public SqlBuilder OnSuccess(string sql)
OutputClass(string)
Sets the POCO type name for result mapping.
public SqlBuilder OutputClass(string typeName)
OutputHeader(IExpression)
Sends the result to a header instead of the body.
public SqlBuilder OutputHeader(IExpression headerName)
OutputType(SqlOutputType)
Sets how query results are mapped.
public SqlBuilder OutputType(SqlOutputType type)
Param(string, IExpression)
Binds a SQL parameter to an expression, resolved at runtime.
public SqlBuilder Param(string name, IExpression expression)
Param(string, object?)
Binds a SQL parameter to an explicit value, overriding auto-bind from headers/body.
public SqlBuilder Param(string name, object? value)
PlaceholderStyle(SqlPlaceholderStyle)
How :#name placeholders are written for the provider: (the default), :name (Oracle) or
public SqlBuilder PlaceholderStyle(SqlPlaceholderStyle style)
PollDelivery(SqlPollDelivery)
How polled rows reach the route: an exchange per row (the default) or one exchange with every row
public SqlBuilder PollDelivery(SqlPollDelivery delivery)
ReadOnly()
Runs the statement on the data source's read replica. Declare it only for a statement that does not write; a batch, and a
public SqlBuilder ReadOnly()
RepeatCount(IExpression)
Sets the repeat count from an expression.
public SqlBuilder RepeatCount(IExpression count)
RouteEmptyResultSet()
Creates an Exchange even on empty result.
public SqlBuilder RouteEmptyResultSet()
SendEmptyMessageWhenIdle()
Sends idle notification when nothing to poll.
public SqlBuilder SendEmptyMessageWhenIdle()
WithIsolationLevel(IsolationLevel)
Sets the transaction isolation level.
public SqlBuilder WithIsolationLevel(IsolationLevel level)