sqlpage / SQLPage

Fast SQL-only data application builder. Automatically build a UI on top of SQL queries.
https://sql.datapage.app
MIT License
1.57k stars 89 forks source link

csv component: after the `#` will be truncated #525

Closed BlueHtml closed 1 month ago

BlueHtml commented 1 month ago

Introduction

When there is a # in the CSV data, the data after the # will be truncated.

To Reproduce

List of steps to reproduce the behavior. Include the sql file you are using and the eventual relevant parts of your database schema


select 
    'csv'              as component,
    'Download my data' as title,
    'people'           as filename,
    'file-download'    as icon,
    'green'            as color;

select 
top 100 *
from [Ban].[dbo].[Port];

Actual behavior

Screenshots

The data in the database is shown in the following figure: image

The generated html contains data after #, as shown in the following figure: image

Click the download button to download the file, and the data after # is gone. As shown in the following figure: image

Version information

lovasoa commented 1 month ago

Hi and welcome to SQLPage !

Thank you for the report; this is indeed a bug.

Until this is fixed, you can encode the problematic column manually in sql:

select 
    'csv'              as component,
    'Download my data' as title,
    'people'           as filename,
    'file-download'    as icon,
    'green'            as color;

select 
  Id, ProjectId, REPLACE(Name, '#', '%23') as Name, Type
from [Ban].[dbo].[Port];