pub enum ParamValue {
Show 21 variants
Null,
Bool(bool),
Int16(i16),
Int32(i32),
Int64(i64),
Float32(f32),
Float64(f64),
Numeric(String),
Text(String),
Bytes(Vec<u8>),
Date(i32),
Time(i64),
Timestamp(i64),
TimestampTz(i64),
Interval {
months: i32,
days: i32,
microseconds: i64,
},
Uuid([u8; 16]),
Json(String),
Array {
elements: Vec<ParamValue>,
dimensions: Vec<i32>,
},
Range {
lower: Option<Box<ParamValue>>,
upper: Option<Box<ParamValue>>,
lower_inc: bool,
upper_inc: bool,
},
Composite {
fields: Vec<ParamValue>,
},
Unknown {
oid: u32,
data: Vec<u8>,
},
}Expand description
Represents a typed parameter value from PostgreSQL’s Bind message.
Covers core PostgreSQL types with an Unknown escape hatch for
extension types or unrecognized OIDs.
Variants§
Null
SQL NULL
Bool(bool)
Boolean (OID 16)
Int16(i16)
16-bit integer (OID 21)
Int32(i32)
32-bit integer (OID 23)
Int64(i64)
64-bit integer (OID 20)
Float32(f32)
32-bit float (OID 700)
Float64(f64)
64-bit float (OID 701)
Numeric(String)
Arbitrary precision numeric as string (OID 1700)
Text(String)
Text string (OID 25, 1043 varchar, etc.)
Bytes(Vec<u8>)
Binary data (OID 17 bytea)
Date(i32)
Date as days since 2000-01-01 (OID 1082)
Time(i64)
Time as microseconds since midnight (OID 1083)
Timestamp(i64)
Timestamp as microseconds since 2000-01-01 (OID 1114)
TimestampTz(i64)
Timestamp with timezone as microseconds since 2000-01-01 UTC (OID 1184)
Interval
Interval (OID 1186)
Uuid([u8; 16])
UUID as 16 bytes (OID 2950)
Json(String)
JSON/JSONB as string (OID 114, 3802)
Array
Array of values (OID varies)
Range
Range type (OID varies)
Composite
Composite/record type (OID varies)
Fields
fields: Vec<ParamValue>Unknown
Unknown or extension type - escape hatch
Trait Implementations§
Source§impl Clone for ParamValue
impl Clone for ParamValue
Source§fn clone(&self) -> ParamValue
fn clone(&self) -> ParamValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more