Skip to main content

Module wire

Module wire 

Expand description

The JSON the /sql endpoint answers with.

Mirrors node-postgres’ result shape, which is what Neon’s serverless driver exposes and therefore what the HTTP endpoint emits. It is reproduced here as Deserialize types rather than read out of a serde_json::Value by hand so that a schema drift is a NeonError::MalformedResponse with a serde_json error inside it, at a named field, instead of a None three layers down.

§How every scalar arrives, measured rather than assumed

The endpoint renders every value as JSON, and the renderings are not the ones a reader guesses:

Postgres typeJSON
biginta string — "9223372036854775807", which is why nothing here loses precision to f64
integera number
byteaa \x… hex string, so the adapter selects encode(col, 'base64') instead and pays 33% rather than 100%
text[]a JSON array of strings
NULLnull, at any type

Every SELECT this crate emits casts its bigint columns with ::text explicitly, so the decoders never have to distinguish “the endpoint chose a string” from “the endpoint chose a number”.

Structs§

FieldDescription
One column of a result set.
ResultSet
The result of one statement.

Enums§

ResponseBody
The body of a successful /sql response.