Skip to content

JSON output format (--json) #44

@vmvarela

Description

@vmvarela

Description

Currently sql-pipe only outputs CSV. Adding JSON output (--json) would make the tool much more useful in pipelines with jq, APIs, and modern CLI workflows.

Acceptance Criteria

  • --json flag outputs results as a JSON array of objects
  • Each row is an object with column names as keys
  • Numeric values are JSON numbers (not strings)
  • NULL values are represented as JSON null
  • Empty result set outputs []
  • --json is mutually exclusive with --delimiter / --tsv / --header
  • Man page and README updated

Notes

  • Example: echo "name,age\nAlice,30" | sql-pipe "SELECT * FROM stdin" --json[{"name":"Alice","age":30}]
  • Zig's std.json can handle serialization
  • Complements the existing CSV/TSV output modes

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:mediumShould be done soonsize:mMedium — 4 to 8 hoursstatus:readyRefined and ready for sprint selectiontype:featureNew functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions