pub enum TypeAffinity {
Text,
Numeric,
Integer,
Real,
None,
}Expand description
SQLite Type Affinity
SQLite uses type affinity to determine how values are compared and stored. This enum represents the five affinity types defined by SQLite:
- TEXT: String comparison semantics
- NUMERIC: Numeric comparison, converts strings to numbers when possible
- INTEGER: Prefers integer storage
- REAL: Floating-point storage
- BLOB/NONE: No affinity, uses type ordering for cross-type comparisons
See: https://www.sqlite.org/datatype3.html
Variants§
Text
TEXT affinity - string comparison semantics When comparing TEXT vs INTEGER, converts INTEGER to TEXT
Numeric
NUMERIC affinity - tries to convert to number first
Integer
INTEGER affinity - prefers integer storage
Real
REAL affinity - floating-point storage
None
BLOB/NONE affinity - no type preference, uses type ordering This is used for bare columns with no declared type
Trait Implementations§
Source§impl Clone for TypeAffinity
impl Clone for TypeAffinity
Source§fn clone(&self) -> TypeAffinity
fn clone(&self) -> TypeAffinity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TypeAffinity
impl Debug for TypeAffinity
Source§impl PartialEq for TypeAffinity
impl PartialEq for TypeAffinity
impl Copy for TypeAffinity
impl Eq for TypeAffinity
impl StructuralPartialEq for TypeAffinity
Auto Trait Implementations§
impl Freeze for TypeAffinity
impl RefUnwindSafe for TypeAffinity
impl Send for TypeAffinity
impl Sync for TypeAffinity
impl Unpin for TypeAffinity
impl UnwindSafe for TypeAffinity
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
Mutably borrows from an owned value. Read more