Skip to content

Print row count loaded from stdin #83

@vmvarela

Description

@vmvarela

Description

After loading CSV data, sql-pipe gives no confirmation of how many rows were inserted. When processing large or unfamiliar files, users are left guessing whether the input was read correctly.

Example

$ cat sales.csv | sql-pipe 'SELECT region, SUM(revenue) FROM t GROUP BY region'
# After results:
# (or to stderr before results:)
# Loaded 42,317 rows

Acceptance Criteria

  • After all CSV rows are inserted, print Loaded <n> rows to stderr (never stdout, to preserve pipe-ability)
  • Row count is formatted with thousands separators for readability (e.g. 42,317 not 42317)
  • Output is only printed when stderr is a TTY — suppress in non-interactive mode to avoid noise in scripts
  • Controlled by a --verbose / -v flag (off by default) OR always-on to stderr; decide and document
  • README.md updated to describe the behaviour
  • Test verifies correct count is emitted

Notes

  • Print to stderr so stdout remains clean CSV/JSON
  • The count is available after the insert loop in src/main.zig
  • Printing only when isatty(stderr) is the conventional Unix approach

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:mediumShould be done soonsize:xsTrivial — less than 1 hourstatus:readyRefined and ready for sprint selectiontype:featureNew functionality

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions