A reactive model that builds structured JSON from PostgreSQL Records