A typed wrapper around a JSON scalar that implements
[postgres::types::ToSql] for INSERT/UPDATE parameters.
The previous implementation passed every value as String, which broke
non-text columns (the postgres driver can’t bind a string literal into
an INTEGER / BOOLEAN / TIMESTAMPTZ slot) and silently turned JSON
null into the empty string for nullable FKs (so unlink left
dangling "" references instead of NULL). JsonParam carries the
JSON variant tag through to to_sql so the driver can pick the
correct binary representation per column type.
JSON arrays/objects collapse to their JSON-string form (TEXT) — the
runtime layer doesn’t currently model array/object columns at the
manifest level on Postgres, so anything that lands here came from
caller-supplied prose that’s expected to fit into a TEXT column.
Lift a serde_json::Value into the typed parameter form. Numbers
that fit i64 go through as Int; everything else goes through as
Float to preserve fractional / large-magnitude values.