Skip to content

[BUG] CSV output does not re-quote fields containing commas or double quotes #102

@ket000

Description

@ket000

What happened?

After the RFC 4180 input parsing fix (#3), fields containing commas,
double quotes, or newlines are now parsed correctly from input.

However, the CSV output writer does not re-apply RFC 4180 quoting
rules. Fields that require quoting are written as plain unquoted text,
producing invalid CSV.

Steps to Reproduce

Steps to reproduce:

echo 'name,description
Alice,"has a ""nickname"""
Bob,"value, with comma"' | sql-pipe -H "SELECT * FROM t"

Expected Behavior

Expected:
name,description
Alice,"has a ""nickname"""
Bob,"value, with comma"

Actual:
name,description
Alice,has a "nickname"
Bob,value, with comma

Environment / Context

Environment:

  • sql-pipe version: 0.4.0
  • OS: Arch Linux

Severity

critical — app crashes or data loss

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions