Skip to content

feat: TOML and CSV format support #68

Description

@daavidrgz

Summary

Extend gq's format support beyond JSON and YAML to include TOML (input + output) and CSV (output, possibly input).

Motivation

  • TOML is the standard config format in the Rust, Python (pyproject.toml), and Go ecosystems. Supporting it rounds out the "config file processing" story and makes gq the universal config query tool.
  • CSV output is the universal data interchange format for piping into spreadsheets, pandas, databases, and other tabular tools. It's extremely practical for data pipeline work.

Proposed Behavior

# TOML input, JSON output
gq -i toml -o json '{ package { name, version } }' < Cargo.toml

# JSON input, CSV output
gq -o csv '{ users { name, email } }' < data.json

# Cross-format conversion becomes a killer use case on its own
gq -i toml -o yaml < config.toml

Considerations

  • TOML has datetime types that don't exist in JSON/YAML — how should these be represented?
  • CSV output only makes sense for flat/tabular data — should gq auto-flatten nested structures or error?
  • CSV input would require inferring types (string vs number) — worth the complexity?
  • Existing DataFormat enum in crates/core/src/data/format.rs would need to be extended

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions