PostgREST / postgrest

REST API for any Postgres database
https://postgrest.org
MIT License
23.42k stars 1.03k forks source link

Feature request: option to change delimiter character for CSV output #1102

Closed nextstopsun closed 1 year ago

nextstopsun commented 6 years ago

Now you can only output CSV as a comma-separated file, but in many cases semicolons, tabs and other characters are needed. I would be great to have such an option.

steve-chavez commented 6 years ago

There's a media type for tabs, text/tab-separated-values, however there's no media type for other delimiters like semicolons, pipes and colons.

We could make a vendor media type for delimiter-separated values, with a parameter for specifying the delimiter, was thinking of application/vnd.pgrst.dsv; delimiter=":";, according to RFC 2045 we would have to quote the delimiters, not sure for now if we can have a delimiter="\t" for tabs, if we cannot, then maybe we'd have to support both the official tsv and vendored dsv media types.