Skip to main content

Module row_json

Module row_json 

Source
Expand description

Conversion of PostgreSQL rows to JSON.

Shared by every adapter that returns query results (the HTTP server, the Lambda adapter). Keeping one implementation matters: a per-adapter copy that reads every column as serde_json::Value silently yields null for anything that is not json/jsonb, because sqlx cannot decode an int4 into a JSON value.

Functionsยง

row_to_json
Convert a sqlx row to a JSON object, decoding each column by its PostgreSQL type.