pub enum StatementKind {
ReadOnly,
Ddl,
Dml,
TransactionControl,
Other,
}Expand description
Coarse classification of a single SQL statement, comment-aware.
Used by the atomic-batch execute tool to enforce the rule “a batch
must be either all-DDL singletons or all-DML; mixing the two aborts
the transaction with SQLSTATE 0A000”. The first-keyword heuristic
matches what is_read_only_sql already trusts elsewhere in the
codebase.
Variants§
ReadOnly
SELECT / WITH / EXPLAIN / SHOW / VALUES.
Ddl
CREATE / DROP / ALTER / TRUNCATE / RENAME — Hyper auto-commits.
Dml
INSERT / UPDATE / DELETE / COPY / MERGE — transactional.
TransactionControl
BEGIN / START / COMMIT / END / ROLLBACK / ABORT /
SAVEPOINT / RELEASE. Rejected inside a batch because the
execute tool already manages the transaction; an explicit
COMMIT mid-batch would defeat atomicity.
Other
Empty/comment-only input or an unrecognized first keyword. Treated as opaque by the batch validator (passed through to Hyper).
Trait Implementations§
Source§impl Clone for StatementKind
impl Clone for StatementKind
Source§fn clone(&self) -> StatementKind
fn clone(&self) -> StatementKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StatementKind
Source§impl Debug for StatementKind
impl Debug for StatementKind
impl Eq for StatementKind
Source§impl PartialEq for StatementKind
impl PartialEq for StatementKind
impl StructuralPartialEq for StatementKind
Auto Trait Implementations§
impl Freeze for StatementKind
impl RefUnwindSafe for StatementKind
impl Send for StatementKind
impl Sync for StatementKind
impl Unpin for StatementKind
impl UnsafeUnpin for StatementKind
impl UnwindSafe for StatementKind
Blanket Implementations§
impl<T> Allocation for T
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request