pub struct BackendCapabilities {Show 13 fields
pub kind: BackendKind,
pub transactions: TransactionSupport,
pub row_locking: RowLocking,
pub joins: bool,
pub returning: bool,
pub window_functions: bool,
pub regex: bool,
pub arrays: bool,
pub distinct_on: bool,
pub ilike: bool,
pub statistical_aggregates: bool,
pub max_params: usize,
pub isolation_levels: &'static [IsolationLevel],
}Expand description
Declared capabilities of a backend.
Fields§
§kind: BackendKindBackend family.
transactions: TransactionSupportTransaction support level.
row_locking: RowLockingRow-locking support level.
joins: boolJOIN support.
returning: boolRETURNING support.
window_functions: boolWindow function support.
regex: boolRegex lookups.
arrays: boolNative arrays.
distinct_on: boolDISTINCT ON.
ilike: boolNative ILIKE.
statistical_aggregates: boolSTDDEV / VARIANCE aggregates.
max_params: usizeMost bind parameters one statement may carry; bulk operations chunk their rows to stay below it.
isolation_levels: &'static [IsolationLevel]Isolation levels that can be requested explicitly.
Implementations§
Source§impl BackendCapabilities
impl BackendCapabilities
Sourcepub const fn sqlite() -> Self
pub const fn sqlite() -> Self
Capabilities of SQLite (3.35+ for RETURNING, 3.25+ for windows).
SQLite has no row locking, no built-in REGEXP function and no
STDDEV / VARIANCE. Its transactions are always serializable. The
parameter limit is that of SQLite 3.32 and later.
Sourcepub const fn mysql() -> Self
pub const fn mysql() -> Self
Capabilities of MySQL 8.0.31+ (tested on 9.x).
returningistruealthough MySQL has noRETURNINGclause: the adapter emulates it (generated keys viaLAST_INSERT_ID(), other writes by re-reading the affected rows in the same transaction).- There is no
DISTINCT ON, no native array type or array aggregate and noILIKE(emulated withLOWER(..) LIKE LOWER(..)). - Regex uses
REGEXP_LIKE; row locking supportsNOWAITandSKIP LOCKED; all three isolation levels can be requested.
Sourcepub const fn mongodb() -> Self
pub const fn mongodb() -> Self
Capabilities of MongoDB (5.0+; transactions need a replica set).
The plan is compiled to filters and aggregation pipelines: no joins,
row locking, window functions, arrays, DISTINCT ON, subqueries, set
operations or raw SQL. RETURNING is emulated by the adapter.
Transactions are flat (no savepoints) and no isolation level can be
requested. max_params bounds the rows per insert_many batch.
Sourcepub const fn redis() -> Self
pub const fn redis() -> Self
Capabilities of Redis as a key, hash and set store.
Redis is not a QuerySet backend. Every relational feature is
unsupported, so a plan checked against these capabilities fails with a
BackendCapabilityError before any I/O. Multi-key atomicity is one
MULTI/EXEC (TransactionSupport::Flat): there are no savepoints
and no SQL isolation levels. max_params is 0 because Redis does not
bind SQL parameters.
Trait Implementations§
Source§impl Clone for BackendCapabilities
impl Clone for BackendCapabilities
Source§fn clone(&self) -> BackendCapabilities
fn clone(&self) -> BackendCapabilities
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BackendCapabilities
impl Debug for BackendCapabilities
impl Eq for BackendCapabilities
Source§impl PartialEq for BackendCapabilities
impl PartialEq for BackendCapabilities
impl StructuralPartialEq for BackendCapabilities
Auto Trait Implementations§
impl Freeze for BackendCapabilities
impl RefUnwindSafe for BackendCapabilities
impl Send for BackendCapabilities
impl Sync for BackendCapabilities
impl Unpin for BackendCapabilities
impl UnsafeUnpin for BackendCapabilities
impl UnwindSafe for BackendCapabilities
Blanket Implementations§
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.