\set data_type random(0, 5)

BEGIN;

-- Generate a random JSONB string, cast it, and get its type
SELECT jsonb_typeof(
    CASE
        :data_type
        WHEN 0 THEN '{"key1": "value"}'::jsonb
	WHEN 1 THEN '{"key2": "value"}'::jsonb
	WHEN 2 THEN '{"key3": "value"}'::jsonb
        WHEN 3 THEN '[1, 2, 3]'::jsonb
	WHEN 4 THEN '[1, 2, 3]'::jsonb
        ELSE '123'::jsonb
    END
);

END;
