We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9054f9b commit 7eee130Copy full SHA for 7eee130
src/renderer/screens/DatabaseScreen/QueryResultViewer/useDataTableContextMenu.tsx
@@ -79,13 +79,19 @@ export default function useDataTableContextMenu({
79
}
80
81
function onCopyAsJson() {
82
- window.navigator.clipboard.writeText(
83
- JSON.stringify(
84
- selectedRowsIndex.map((rowIndex) => data[rowIndex].data),
85
- undefined,
86
- 2,
+ const jsonFriendly = selectedRowsIndex.map((rowIndex) =>
+ Object.entries(data[rowIndex].data).reduce(
+ (acc, [colName, colValue]) => {
+ acc[colName] = colValue.toNullableString();
+ return acc;
87
+ },
88
+ {} as Record<string, unknown>,
89
),
90
);
91
+
92
+ window.navigator.clipboard.writeText(
93
+ JSON.stringify(jsonFriendly, undefined, 2),
94
+ );
95
96
97
function onCopyAsMarkdown() {
0 commit comments