#[non_exhaustive]pub enum Param {
Show 13 variants
Now,
Group,
Limit,
Id,
Ids,
RetryAfter,
Destination,
Delay,
Lease,
LeaseNow,
Held,
Key,
Column(usize),
}Expand description
A value a statement binds, named by its meaning; the broker supplies it when the statement runs.
§Examples
use ruststream_sqlx_dialect::{Dialect, Param, Statement, StatementError, TableSpec};
/// SQL Server, a database without a built-in dialect.
#[derive(Debug)]
pub struct Mssql;
impl Dialect for Mssql {
fn name(&self) -> &'static str {
"mssql"
}
// A delayed retry of a leased email names the row and the lease its delivery holds; the
// broker binds the delay's end, the id and the lease, in this order.
fn retry_after(&self, _spec: &TableSpec<'_>) -> Result<Statement, StatementError> {
Ok(Statement::new(
"UPDATE [email_jobs] SET [retry_after] = @p1, [locked_until] = NULL \
WHERE [job_id] = @p2 AND [locked_until] = @p3",
[Param::RetryAfter, Param::Id, Param::Held],
))
}
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Now
The current time, in the type of the column it meets.
Group
The group the subscription reads.
Limit
The most rows one claim takes.
Id
The id of the row being settled.
Ids
The ids a fetch assembles, as one list.
RetryAfter
The time before which a row is not claimed again.
Destination
Where a dead-lettered row goes: the name of its new group.
Delay
The delay of a retry in microseconds, for a statement that adds it to the database’s own time.
Lease
The expiry a claim, a stamp or an extension writes into the lease column: the row stays with its delivery until then.
LeaseNow
The current time, in the type of the lease column: a row whose lease ended by then is claimable.
Held
The expiry the delivery’s claim or its last extension wrote: the ownership token that settlement and extension match.
Key
The lock key of the row, as text: what the advisory claim selected as __lock, which the
lock and the unlock name.
Column(usize)
The value of the column at this position of TableSpec::columns,
for an insert.