Expand description
Routines for converting datum values to and from their string representation.
The functions in this module are tightly related to the variants of
SqlScalarType. Each variant has a pair of functions in
this module named parse_VARIANT and format_VARIANT. The type returned
by parse functions, and the type accepted by format functions, will
be a type that is easily converted into the Datum variant
for that type. The functions do not directly convert from Datums to
Strings so that the logic can be reused when Datums are not available or
desired, as in the pgrepr crate.
The string representations used are exactly the same as the PostgreSQL string representations for the corresponding PostgreSQL type. Deviations should be considered a bug.
Modulesยง
- proto_
parse_ error - Nested message and enum types in
ProtoParseError. - proto_
parse_ hex_ error - Nested message and enum types in
ProtoParseHexError.
Macrosยง
- bail ๐
Structsยง
- List
Element ๐Escaper - List
Element Writer - A helper for
format_listthat formats a single list element. - MapElement
Escaper ๐ - MapValue
Writer - A helper for
format_mapthat formats a single map value. - Parse
Error - An error while parsing an input as a type.
- Proto
Parse Error - Proto
Parse HexError - Range
Element Writer - A helper for
format_rangethat formats a single record element. - Record
Element ๐Escaper - Record
Element Writer - A helper for
format_recordthat formats a single record element.
Enumsยง
- Array
Parsing ๐Error - Nestable
- Yes should be provided for types that will never return true for
ElementEscaper::needs_escaping - Parse
Error Kind - Parse
HexError
Traitsยง
Functionsยง
- escape_
elem ๐ - Escapes a list, record, or map element in place.
- format_
acl_ item - Writes an
acl_itemtobuf. - format_
array - format_
array_ inner - format_
bool - Writes a boolean value into
buf. - format_
bool_ static - Like
format_bool, but returns a string with a static lifetime. - format_
bytes - format_
date - Writes a
Datetobuf. - format_
elems - Writes each
elemintobuf, separating the elems withsep. - format_
float ๐ - format_
float32 - Writes an
f32tobuf. - format_
float64 - Writes an
f64tobuf. - format_
int16 - Writes an
i16tobuf. - format_
int32 - Writes an
i32tobuf. - format_
int64 - Writes an
i64tobuf. - format_
interval - format_
jsonb - format_
jsonb_ pretty - format_
legacy_ vector - format_
list - format_
map - format_
mz_ acl_ item - Writes an
mz_acl_itemtobuf. - format_
mz_ timestamp - Writes an
mz_timestamptobuf. - format_
nanos_ ๐to_ micros - format_
numeric - format_
range - Writes a
Rangetobuf. - format_
record - format_
string - format_
time - Writes a
NaiveDateTimetimestamp tobuf. - format_
timestamp - Writes a
NaiveDateTimetimestamp tobuf. - format_
timestamptz - Writes a
DateTime<Utc>timestamp tobuf. - format_
uint16 - Writes an
u16tobuf. - format_
uint32 - Writes an
u32tobuf. - format_
uint64 - Writes an
u64tobuf. - format_
uuid - lex_
embedded_ ๐element - lex_
quoted_ ๐element - lex_
unquoted_ ๐element - parse_
acl_ item - Parses an AclItem from
s. - parse_
array - parse_
array_ ๐inner - parse_
bool - Parses a
boolfroms. - parse_
bytes - parse_
bytes_ hex - parse_
bytes_ traditional - parse_
date - Parses a
Datefroms. - parse_
float ๐ - parse_
float32 - Parses an
f32froms. - parse_
float64 - Parses an
f64froms. - parse_
int16 - Parses an
i16froms. - parse_
int32 - Parses an
i32froms. - parse_
int64 - Parses an
i64froms. - parse_
interval - parse
- parse_
interval_ w_ disambiguator - Parse an interval string, using an optional leading precision for time (H:M:S) and a specific mz_sql_parser::ast::DateTimeField to identify ambiguous elements. For more information about this operation, see the documentation on ParsedDateTime::build_parsed_datetime_interval.
- parse_
jsonb - parse_
legacy_ vector - parse_
legacy_ vector_ inner - parse_
list - parse_
list_ ๐inner - parse_
map - parse_
map_ ๐inner - parse_
mz_ acl_ item - Parses an MzAclItem from
s. - parse_
mz_ timestamp - Parses an
mz_timestampfroms. - parse_
numeric - parse_
oid - Parses an OID from
s. - parse_
pg_ legacy_ name - parse_
range - parse_
range_ ๐inner - parse_
time - Parses a
NaiveTimefroms, using the following grammar. - parse_
timestamp - Parses a
NaiveDateTimefroms. - parse_
timestamp_ ๐string - Use the following grammar to parse
sinto: - parse_
timestamptz - Parses a
DateTime<Utc>froms. Seemz_expr::scalar::func::timezone_timestampfor timezone anomaly considerations. - parse_
uint16 - Parses an
u16froms. - parse_
uint32 - Parses an
u32froms. - parse_
uint64 - Parses an
u64froms. - parse_
uuid