studio icon indicating copy to clipboard operation
studio copied to clipboard

Markdown, Ascii Table and more export parameters

Open invisal opened this issue 1 year ago • 0 comments

We would like to improve our export feature. The code of the design is already push in this branch https://github.com/invisal/libsql-studio/tree/export-more-params-and-format

image

  • User can select Complete (the whole result), Selected (only the selected rows)
  • User can select output target
    • File (download into file)
    • Clipboard (just save to clipboard)
  • Introduce two more format: Markdown and Ascii.
  • Each option now have more parameters.

SQL Option

  • Table Name (user can specify what should be the table name)
  • Batch Size

In SQL, you can insert in batch as the following

INSERT INTO table(...) VALUES 
  (...),
  (...),
  (...);

Markdown

We can export the result into markdown table.

| Column 1      | Column 2      |
| ------------- | ------------- |
| Cell 1, Row 1 | Cell 2, Row 1 |
| Cell 1, Row 2 | Cell 1, Row 2 |

The "Column Text Limit" controls what is the max text length for each column. If the cell text exceeds the limit, it will crop it out and add "..."

ASCII Table

Generate the ASCII table looking. It is good for copy and paste on Stackoverflow

+-------+-----+-----------+
| Name  | Age | Eye color |
+-------+-----+-----------+
| John  |  23 |   green   |
| Mary  |  16 |   brown   |
| Rita  |  47 |   blue    |
| Peter |   8 |   brown   |
+-------+-----+-----------+

invisal avatar Jun 28 '24 13:06 invisal