Insert String, Integer, Map, List in a jsonb PostgreSQL column

I think wrapping into single key shouldn’t affect any business logic.

%{data: "toto"}
%{data: 12}
%{data: [1,2]}

Actually, to avoid struct.data.data just name it jsonb! so you retrieve it struct.data.jsonb .. I think it makes sense.