Skip to content

Result Set view new features - #595

Open
buzzia2001 wants to merge 6 commits into
mainfrom
newFeaturesRS
Open

buzzia2001 wants to merge 6 commits into
mainfrom
newFeaturesRS

Conversation

@buzzia2001

@buzzia2001 buzzia2001 commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Changes

Export the result set as CSV, JSON, Markdown or SQL INSERT (#588)

  • New "Export as..." submenu in the result set toolbar, both in the panel view and when the result set is moved into the editor area.
  • Each format opens in a new untitled editor tab, the same way the csv:, json:, md: and sql: statement prefixes do. The prefixes and the menu now share the same formatting code (export.ts).
  • If not all rows have been fetched yet, a quick pick asks whether to retrieve all of them first or export only the loaded rows.
  • CSV output uses the column delimiter setting and the decimal separator setting added in feat: add configuration for CSV decimal separator and update CSV formatting logic #594 (merged from main), for both the menu and the prefixes.
image

Parameter values in the result set (#589)

  • When a statement runs with parameter markers (? or named :NAME), the info button in the result set toolbar now lists the values that were used, below the filter/sort text. It also shows when no filter or sort is applied, and for CALL statements.
  • Named markers are listed as :NAME, positional ones as Parameter marker N, matching the bind prompt. A name used more than once is listed once.
  • "Copy SQL" now writes the values into the statement as literals (with quotes escaped), so the copied SQL runs as is. With a filter or sort applied, the copied statement includes both.
image image

Column details on the column heading (#590)

  • Hovering a column heading shows the column metadata, like ACS: Name, Type, Precision, Scale, Nullable and Label, plus Table and Auto increment when available.
  • Nullable, Table and Auto increment are only sent by newer Mapepire servers. With older servers those rows are left out.
  • This replaces the previous native tooltip, which showed only the type and the label.
image

Add, change and delete rows in an updatable result set (#593)

  • New "Make Updatable" button (pencil) in the result set toolbar, both in the panel view and in the editor area. It re-runs the current SELECT as if it had the update: prefix. It is shown only for a SELECT on a qualified table. An "Editing LIB.TABLE" badge next to the statement shows that the result set is in edit mode. In edit mode the toolbar shows "Add Row" (+) and "Exit Edit Mode" (lock). Exit Edit Mode re-runs the statement without update:.
  • The statement that will run is now shown in a bar above the grid instead of the footer, and long statements wrap. When nothing is being edited, the bar explains how to change, add and delete rows.
  • Add Row opens a new row at the top of the grid. Empty cells are left out of the INSERT, so they get their default. Shift+Enter sets a nullable column to null. Enter runs the INSERT. If it fails, the row stays so the values can be fixed.
  • Delete Row is in the right-click menu of a row. The DELETE, with its values, is shown for confirmation before it runs.
  • UPDATE and DELETE now follow the vscode-db2i.schemaBrowser.crudUseKeyColumns setting, like the generated CRUD statements: when it is on (the default), the row is identified by the table's primary or unique key, and the identity column or RRN is used only when there is no such key or the setting is off.
image image

How to test this PR

  1. Run the test cases (npm test). New suites: export.test.ts and parameterInfo.test.ts.
  2. Run select * from qiws.qcustcdt where state= :thestate, enter the values in the prompt, and hover the info icon in the result set toolbar. The two values should be listed.
  3. Click "Copy SQL" and paste: the values should replace the markers. Add a search filter and sort a column, copy again, and check that the pasted statement runs.
  4. Open "Export as..." and pick each format: each one should open in a new editor tab. Before all rows are fetched, check that you are asked to retrieve all rows or only the loaded ones.
  5. Hover a column heading: the column details should be shown.
  6. Move the result set into the editor area and repeat steps 2–6.
  7. Run select * from qiws.qcustcdt: the pencil should be in the toolbar. Click it: the RRN column, the "Editing" badge and the + and lock buttons should appear.
  8. Click a cell, change the value and press Enter: the UPDATE is shown above the grid while typing, and the rows reload after Enter.
  9. Click +, fill in some columns and press Enter: the INSERT is shown while typing, and the new row is there after the reload. Try a letter in a numeric column, and Shift+Enter in a nullable one.
  10. Right-click a row and pick Delete Row: the DELETE should be shown for confirmation, and the row removed after it.
  11. On a table with a primary key, check that the UPDATE and DELETE use the key instead of RRN. Run a select without one of the key columns: editing a cell should show the message and Delete Row should not be offered.
  12. Click the lock: the result set goes back to read-only and the pencil comes back.

Checklist

  • have tested my change
  • have created one or more test cases
  • updated relevant documentation
  • Remove any/all console.logs I added
  • have added myself to the contributors' list in CONTRIBUTING.md

Closes #588
Closes #589
Closes #590
Closes #593

@buzzia2001 buzzia2001 self-assigned this Oct 25, 2026
@buzzia2001 buzzia2001 added the enhancement New feature or request label Oct 25, 2026
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

👋 A new build is available for this PR based on d6df824.

@SanjulaGanepola SanjulaGanepola left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have Export as ... instead of Copy as... and pop the content into an untitled file just like the prefixes?

Comment thread src/views/results/export.ts Resolved
Comment thread src/views/results/export.ts Resolved
@buzzia2001
buzzia2001 marked this pull request as ready for review October 27, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

2 participants