clockworklabs / clockworklabs/SpacetimeDB
cli: Support more output format in the `sql` and `subscribe` commands
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 25.2k
- Forks
- 1.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 46
Description
This issue tracks reimplementing the work from stale PR #1437, which has been closed because it is too far out of date to merge directly.
## Original pull request
- PR #1437: [cli: Support more output format in the `sql` and `subscribe` commands](https://github.com/clockworklabs/SpacetimeDB/pull/1437)
- Original author: @kim
## What the original PR was trying to do
# Description of Changes
Adds a parameter --output-format to both the sql and subscribe
subcommands, which allows to format the output as either JSON, CSV, or
the ASCII table format familiar from sql.
The JSON and CSV formats are mainly intended to avoid relying on a
specific rendering when writing tests, but there are surely other situations
in which machine-readable output is appreciated.
Note that the layout of the data is adjusted to seemed sensible within the
given context.
Fixes https://github.com/clockworklabs/SpacetimeDB/issues/1307.
Expected complexity level and risk
2
Testing
Deploy the quickstart-chat app and compare the output of the various
commands/options to what is documented in this patch.
## Closure context
- Closed from the `close-stale-pr-create-issue` stale-PR sweep.
## Reimplementation notes
- Reimplement this work on top of current `master` in a new PR.
- Keep the original PR linked as historical context and as a source of useful implementation ideas where still relevant.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing stale PR #1437 and the current entry points for the sql and subscribe commands on master. Reimplement the --output-format behavior for JSON, CSV, and ASCII table output, then deploy quickstart-chat and compare each command and option with the documented behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, database
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100