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 type | JSON |
|---|---|
bigint | a string — "9223372036854775807", which is why nothing here loses precision to f64 |
integer | a number |
bytea | a \x… hex string, so the adapter selects encode(col, 'base64') instead and pays 33% rather than 100% |
text[] | a JSON array of strings |
NULL | null, 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§
- Field
Description - One column of a result set.
- Result
Set - The result of one statement.
Enums§
- Response
Body - The body of a successful
/sqlresponse.