pub enum Literal {
Integer(i64),
Float(f64),
String(String),
Bool(bool),
Null,
Vector(Vec<f32>),
TextArray(Vec<Option<String>>),
IntArray(Vec<Option<i32>>),
BigIntArray(Vec<Option<i64>>),
Interval {
months: i32,
days: i32,
micros: i64,
text: String,
},
}Variants§
Integer(i64)
Float(f64)
String(String)
Bool(bool)
Null
Vector(Vec<f32>)
pgvector-style array literal, e.g. [1, 2.5, -3].
TextArray(Vec<Option<String>>)
TEXT[] value carried through the prepared-bind path
(= ANY($1) has no column context to re-parse a {a,b}
text form, so the array rides the AST natively).
IntArray(Vec<Option<i32>>)
INT[] value carried through the prepared-bind path.
BigIntArray(Vec<Option<i64>>)
BIGINT[] value carried through the prepared-bind path.
Interval
INTERVAL '<n> <unit> [<n> <unit> ...]' — calendar-aware span.
Three independent dimensions: months (variable-length;
year/month), days (fixed 86400 seconds at non-DST, but
preserved as its own dimension so '1 day' ≠ '24 hours'
stays distinguishable), and micros (sub-day; can carry).
text keeps the original spelling so Display round-trips
byte-for-byte. v7.37.5 β added the days field for PG parity.
Trait Implementations§
impl StructuralPartialEq for Literal
Auto Trait Implementations§
impl Freeze for Literal
impl RefUnwindSafe for Literal
impl Send for Literal
impl Sync for Literal
impl Unpin for Literal
impl UnsafeUnpin for Literal
impl UnwindSafe for Literal
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