microsoft / microsoft/vscode-pgsql

[Feature Request] Add "Copy as" actions to Results View

Open
#284 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
No language data
Stars
395
Forks
33
Avg merge
1h 46m
Merged PRs (30d)
3

Description

There's options to save as JSON, CSV, or even Excel, but my workflows rarely have me saving results. Instead sharing them in chat threads and comment sections of my company's team and project management tools; especially if the results are one-row results.

I'd like to request "Copy As" actions for the Results View.

From a UI/UX perspective, layered icons with your typical "copy" or "clipboard" icon as the top layer and the output format as the bottom layer would be sufficient. You could line them up below the current "Save as" actions in the results view. For short enough viewports, you could probably collapse the "Save as" actions and "Copy as" actions into their own context menus or even have a "..." menu at the bottom of the actions for "the rest".

Useful "Copy As" actions off the top of my head.

  • json
[
 {
  "column_a": "lorem ipsum",
  "column_b": 1,
  "column_c": "2026-07-16T21:01:15.861Z"
 },
 {
  "column_a": "lorem ipsum",
  "column_b": 1,
  "column_c": "2026-07-16T21:01:15.861Z"
 },
 {
  "column_a": "lorem ipsum",
  "column_b": 1,
  "column_c": "2026-07-16T21:01:15.861Z"
 }
]
  • csv
column_a,column_b,column_c
lorem ipsum,1,2026-07-16T21:01:15.861Z
lorem ipsum,1,2026-07-16T21:01:15.861Z
lorem ipsum,1,2026-07-16T21:01:15.861Z
  • tsv (tabs shown for reference here)
column_a\tcolumn_b\tcolumn_c
lorem ipsum\t1\t2026-07-16T21:01:15.861Z
lorem ipsum\t1\t2026-07-16T21:01:15.861Z
lorem ipsum\t1\t2026-07-16T21:01:15.861Z
  • markdown
| column_a | column_b | column_c |
| --- | --- | --- |
| lorem ipsum | 1 | 2026-07-16T21:01:15.861Z |
| lorem ipsum | 1 | 2026-07-16T21:01:15.861Z |
| lorem ipsum | 1 | 2026-07-16T21:01:15.861Z |
  • fancy text (a format I consistently see in stack overflow, and other forums, answers)
+-------------+----------+--------------------------+
| column_a    | column_b | column_c                 |
+-------------+----------+--------------------------+
| lorem ipsum | 1        | 2026-07-16T21:01:15.861Z |
| lorem ipsum | 1        | 2026-07-16T21:01:15.861Z |
| lorem ipsum | 1        | 2026-07-16T21:01:15.861Z |
+-------------+----------+--------------------------+

There are rendering questions with regards to certain data-types (i.e. jsonb), but I'll leave those implementation answers to the extension developers and community. I'd expect the outputs to be generally close to how they are outputted when I "Save as".

I recognize, and concede, that large results are better served by the "Save as" actions. Maybe there's a character threshold that disables "Copy as" actions or maybe you just let the users deal with the consequences of copying 10,000 rows of 100 columns to their clipboard. Maybe you prompt for confirmation when a copy would be better served by a save. If I were the user, I would know based on the results whether I'm saving or even attempting to copy anyways.

I'm also sure there are many other formats you could save/copy as. The ones listed are examples of formats I've seen or would want myself. If there's one I'd like first, it's json, because it's the most flexible, and probably easiest to implement of the bunch. Second, markdown because I'm seeing more and more tools support markdown input for AI Agents.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the Results View and inspect the existing "Save as" actions and their output formats. Determine how results are currently serialized, then define the supported "Copy as" formats and UI placement; done means users can copy the selected formats from the Results View with output consistent with saving.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, vscode
Domain
desktop, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.