SQLpage icon indicating copy to clipboard operation
SQLpage copied to clipboard

feat: add csv_attachment component

Open mtt-artis opened this issue 5 months ago • 2 comments

Hi 👋,

This commit follows the discussion in #260 (better late than never!). It implements the csv_attachment component to return data as a CSV file.

SELECT 
    'csv_attachment' AS component, 
    ';' AS separator, 
    'todo.csv' AS filename;
SELECT * FROM todos;

It works, but it feels a bit hacky due to the use of is_embedded and Handlebars. Please feel free to make any changes, rename the component, or point me in the right direction.

If you like this implementation, I can add the component to the documentation.

mtt-artis avatar Sep 21 '24 19:09 mtt-artis