Add parsing for nested json objects in resultset (#2163)
This commit is contained in:
parent
c564881867
commit
83ef8a2e12
|
|
@ -190,7 +190,18 @@ class ResultSet extends React.PureComponent {
|
|||
{sql}
|
||||
<div className="ResultSet">
|
||||
<Table
|
||||
data={data}
|
||||
data={data.map(function (row) {
|
||||
const newRow = {};
|
||||
for (const k in row) {
|
||||
const val = row[k];
|
||||
if (typeof(val) === 'string') {
|
||||
newRow[k] = val;
|
||||
} else {
|
||||
newRow[k] = JSON.stringify(val);
|
||||
}
|
||||
}
|
||||
return newRow;
|
||||
})}
|
||||
columns={results.columns.map((col) => col.name)}
|
||||
sortable
|
||||
className="table table-condensed table-bordered"
|
||||
|
|
|
|||
Loading…
Reference in New Issue