diff --git a/src/components/gui/query-result-table.tsx b/src/components/gui/query-result-table.tsx index be013858..19e9c7ba 100644 --- a/src/components/gui/query-result-table.tsx +++ b/src/components/gui/query-result-table.tsx @@ -9,6 +9,7 @@ import OptimizeTableState from "@/components/gui/table-optimized/OptimizeTableSt import { exportRowsToExcel, exportRowsToSqlInsert, + exportRowsToJson, } from "@/components/lib/export-helper"; import { KEY_BINDING } from "@/lib/key-matcher"; import { @@ -434,6 +435,20 @@ export default function ResultTable({ } }, }, + { + title: "Copy as Json", + onClick: () => { + const headers = state + .getHeaders() + .map((column) => column?.name ?? ""); + + if (state.getSelectedRowCount() > 0) { + window.navigator.clipboard.writeText( + exportRowsToJson(headers, state.getSelectedRowsArray()) + ); + } + }, + }, { title: "Copy as INSERT SQL", onClick: () => {