invisal / libsql-studio

A lightweight LibSQL/rqlite graphical client on your browser
https://libsqlstudio.com
MIT License
162 stars 13 forks source link

Markdown, Ascii Table and more export parameters #105

Open invisal opened 2 weeks ago

invisal commented 2 weeks ago

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

SQL Option

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   |
+-------+-----+-----------+