JSON = Type("json") do
            casts = ::Hash.new(-> v { ::Sequel.pg_json(v) })
            json_null = ::Sequel.pg_json_wrap(nil)
            casts[JSONNullType] = -> _ { json_null }
            casts[::NilClass] = -> _ { json_null }