README

jaredzhou/moonpg/value does not have a README file

#
Format

pub(all) enum Format {
Text
Binary
} derive(Eq,
Debug
)

Data format for a PostgreSQL cell or parameter.

Text (format code 0) — human-readable representation. Binary (format code 1) — compact wire-protocol representation.

#
Value

pub(all) enum Value {
Null
Bool(Bool)
Int(Int)
Int64(Int64)
Float(Double)
String(String)
Bytes(Bytes)
Timestamp(Int64)
Json(Json)
Array(Array[Value])
} derive(Eq,
Debug
)

PostgreSQL value type used for encoding (client → server via ToValue) and decoding (server → client via FromValue).

Variants map to PostgreSQL types as follows:

VariantPG types
NullSQL NULL
Boolbool (16)
Intint2 (21), int4 (23)
Int64int8 (20)
Floatfloat4 (700), float8 (701)
Stringtext, varchar, bpchar, name, uuid, …
Bytesbytea (17)
Timestamp(Int64)timestamp (1114), timestamptz (1184)
Json(Json)json (114), jsonb (3802)

Source Files