Record-transformation and value-preparation helpers shared across the
import paths in ConnectionNotifier.
Three concerns:
value/1andvalue/3— convert JSON-transported scalars back into Postgrex-ready terms. ISO8601 strings become DateTime / Date / Time. Decimal-like strings become%Decimal{}only when the target column is numeric (the 3-arity form) — the broad 1-arity form is kept for the PK/unique-key lookup paths where values are known keys, not free-text.numeric_columns/1— returns the list of column names whose type isnumeric/decimal/double precision/realfor a given table. Used by the importer to scope decimal-string detection. Cached once per table-import; empty list on error (safe "don't coerce" fallback).- Record field helpers (
get_field/2,put_field/3,drop_field/2,normalize_keys/1) — records arrive with either string or atom keys depending on whether they came through JSON or internal code. These helpers access/modify fields uniformly without creating atoms from untrusted data.
Extracted from ConnectionNotifier in 2026-04. All functions are pure
or depend only on SchemaInspector (for column introspection) — none
touch HTTP, the socket, or the websocket client.