Skip to content

cli: Support more output format in the sql and subscribe commands #4914

@clockwork-labs-bot

Description

@clockwork-labs-bot

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 #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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions