pub trait MutationSql {
// Required methods
fn exec(
&mut self,
sql: &str,
params: &[OwnedValue],
) -> Result<usize, ReplicaError>;
fn query(
&mut self,
sql: &str,
params: &[OwnedValue],
) -> Result<Vec<Vec<OwnedValue>>, ReplicaError>;
}Expand description
The SQL flavor of the design’s MutationTx (§4.2) — the abstract write handle a
server mutator runs against. Statements execute inside the mutation’s own open
write transaction, and query reads through the same
connection, so a mutator sees its own uncommitted writes and the effects of every
lower-mid mutation — exactly what read-dependent mutators need (§4.1).
Required Methods§
Sourcefn exec(
&mut self,
sql: &str,
params: &[OwnedValue],
) -> Result<usize, ReplicaError>
fn exec( &mut self, sql: &str, params: &[OwnedValue], ) -> Result<usize, ReplicaError>
Run one statement with positional parameters; returns rows changed.
Sourcefn query(
&mut self,
sql: &str,
params: &[OwnedValue],
) -> Result<Vec<Vec<OwnedValue>>, ReplicaError>
fn query( &mut self, sql: &str, params: &[OwnedValue], ) -> Result<Vec<Vec<OwnedValue>>, ReplicaError>
Run a read returning all rows, each cell mapped from its raw SQLite storage
class (INTEGER → Int, REAL → Float, TEXT → Str, NULL → Null; BLOB is
an error). Raw classes, not the engine’s number-widening coercion — the
mutator is writing SQL, not feeding the pipeline.
Implementors§
impl MutationSql for ClusterWriteTxn
The SQL MutationTx flavor (design §4.2) for the parallel write path — a server mutator
runs against the open cluster transaction, reading through the same connection so it
sees its own uncommitted writes (and lower-mid mutations’ effects). Mirrors the
single-thread impl MutationSql for WriteTxn.
impl MutationSql for WriteTxn
The SQL MutationTx flavor (design §4.2): a server mutator runs against the open
single-writer transaction, reading through the same connection so it sees its own
uncommitted writes.