Skip to main content

Module value

Module value 

Source
Expand description

Conversions between JSON (the wire format) and typed SQL values.

Functions§

json_param
Best-effort conversion for untyped params coming from function .sos via the raw-query host callback (we don’t know the target column type there).
json_to_sql
Convert a JSON value into a typed SQL value for the given column type. Returns a human-readable error on a type mismatch (surfaced as a 400).
null_for
The correctly-typed SQL NULL for a column type (Postgres cares about the type of a bound null).
string_to_sql
Convert a raw query-string value (always a string) into a typed SQL value for a column, used for ?field=value filtering.