pub enum Operation {
Insert(Insert),
DeleteByKey(DeleteByKey),
FindPkByIndex(FindPkByIndex),
GetByKey(GetByKey),
QueryPk(QueryPk),
QuerySql(QuerySql),
Transaction(Transaction),
UpdateByKey(UpdateByKey),
}Expand description
A single database operation to be executed by a driver.
Each variant maps to one logical database action. The query planner selects
variants based on the driver’s Capability: SQL
drivers receive QuerySql and Insert,
while key-value drivers receive GetByKey,
QueryPk, etc.
All operation types implement From<T> for Operation, so they can be
converted with .into().
§Examples
use toasty_core::driver::operation::{Operation, Transaction};
let op: Operation = Transaction::start().into();
assert!(!op.is_transaction_commit());Variants§
Insert(Insert)
Insert a new record. Contains a lowered stmt::Insert statement.
DeleteByKey(DeleteByKey)
Delete one or more records identified by primary key.
FindPkByIndex(FindPkByIndex)
Look up primary keys via a secondary index.
GetByKey(GetByKey)
Fetch one or more records by exact primary key match.
QueryPk(QueryPk)
Query a table with a primary key filter, optional secondary filtering, ordering, and pagination.
QuerySql(QuerySql)
Execute a raw SQL statement. Only sent to SQL-capable drivers.
Transaction(Transaction)
A transaction lifecycle operation (begin, commit, rollback, savepoint).
UpdateByKey(UpdateByKey)
Update one or more records identified by primary key.
Implementations§
Source§impl Operation
impl Operation
Sourcepub fn is_query_sql(&self) -> bool
pub fn is_query_sql(&self) -> bool
Returns true if this is a QuerySql operation.
Source§impl Operation
impl Operation
Sourcepub fn is_transaction_commit(&self) -> bool
pub fn is_transaction_commit(&self) -> bool
Returns true if this is a Transaction::Commit operation.