@cubejs-client/core 1.6.38 → 1.6.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cubejs-client-core.cjs.js +25 -5
- package/dist/cubejs-client-core.cjs.js.map +1 -1
- package/dist/cubejs-client-core.umd.js +25 -5
- package/dist/cubejs-client-core.umd.js.map +1 -1
- package/dist/src/format.d.ts.map +1 -1
- package/dist/src/format.js +6 -4
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +22 -6
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/test/format.test.js +11 -11
- package/package.json +3 -3
|
@@ -2929,9 +2929,9 @@
|
|
|
2929
2929
|
}, {
|
|
2930
2930
|
key: "patchQueryInternal",
|
|
2931
2931
|
value: function patchQueryInternal(query, responseFormat) {
|
|
2932
|
-
if (responseFormat === 'compact' && query.responseFormat !==
|
|
2932
|
+
if ((responseFormat === 'compact' || responseFormat === 'columnar') && query.responseFormat !== responseFormat) {
|
|
2933
2933
|
return _objectSpread(_objectSpread({}, query), {}, {
|
|
2934
|
-
responseFormat:
|
|
2934
|
+
responseFormat: responseFormat
|
|
2935
2935
|
});
|
|
2936
2936
|
} else {
|
|
2937
2937
|
return query;
|
|
@@ -2983,6 +2983,26 @@
|
|
|
2983
2983
|
});
|
|
2984
2984
|
response.results[j].data = data;
|
|
2985
2985
|
});
|
|
2986
|
+
} else if (response.results[0].query.responseFormat && response.results[0].query.responseFormat === 'columnar') {
|
|
2987
|
+
response.results.forEach(function (result, j) {
|
|
2988
|
+
var _columns$0$length, _columns$;
|
|
2989
|
+
var _ref9 = result.data,
|
|
2990
|
+
columns = _ref9.columns,
|
|
2991
|
+
members = _ref9.members;
|
|
2992
|
+
var rowCount = (_columns$0$length = (_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.length) !== null && _columns$0$length !== void 0 ? _columns$0$length : 0;
|
|
2993
|
+
var data = [];
|
|
2994
|
+
var _loop = function _loop(i) {
|
|
2995
|
+
var row = {};
|
|
2996
|
+
members.forEach(function (m, k) {
|
|
2997
|
+
row[m] = columns[k][i];
|
|
2998
|
+
});
|
|
2999
|
+
data.push(row);
|
|
3000
|
+
};
|
|
3001
|
+
for (var i = 0; i < rowCount; i++) {
|
|
3002
|
+
_loop(i);
|
|
3003
|
+
}
|
|
3004
|
+
response.results[j].data = data;
|
|
3005
|
+
});
|
|
2986
3006
|
}
|
|
2987
3007
|
}
|
|
2988
3008
|
return new ResultSet(response, {
|
|
@@ -3052,14 +3072,14 @@
|
|
|
3052
3072
|
options = _objectSpread({
|
|
3053
3073
|
castNumerics: this.castNumerics
|
|
3054
3074
|
}, options);
|
|
3055
|
-
if (responseFormat === 'compact') {
|
|
3075
|
+
if (responseFormat === 'compact' || responseFormat === 'columnar') {
|
|
3056
3076
|
if (Array.isArray(query)) {
|
|
3057
3077
|
var patched = query.map(function (q) {
|
|
3058
|
-
return _this5.patchQueryInternal(q,
|
|
3078
|
+
return _this5.patchQueryInternal(q, responseFormat);
|
|
3059
3079
|
});
|
|
3060
3080
|
return [patched, options];
|
|
3061
3081
|
} else {
|
|
3062
|
-
var _patched = this.patchQueryInternal(query,
|
|
3082
|
+
var _patched = this.patchQueryInternal(query, responseFormat);
|
|
3063
3083
|
return [_patched, options];
|
|
3064
3084
|
}
|
|
3065
3085
|
}
|