couchbase-shell icon indicating copy to clipboard operation
couchbase-shell copied to clipboard

Reformat output of 'buckets load sample'

Open Westwooo opened this issue 1 year ago • 0 comments

Currently when a bucket is imported through cbshell the output is:

> buckets load-sample travel-sample
╭───┬─────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ # │ cluster │                                               results                                               │
├───┼─────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 0 │ local   │ {"taskId":"991a2e9c-6993-48e3-b8b0-2d05811e7a8c","sample":"travel-sample","bucket":"travel-sample"} │
╰───┴─────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────╯

This should be improved to fully utilise nushells tables and the result should look like this:

> buckets load-sample travel-sample
╭───┬─────────┬────────────────────────────────────────────────────────────────|
│ # │ cluster │    sample     |.            taskId                   |  status |                                              
├───┼─────────┼───────────────|──────────────────────────────────────|─────────|
│ 0 │ local   │ travel-sample | 991a2e9c-6993-48e3-b8b0-2d05811e7a8c | success |
╰───┴─────────┴────────────────────────────────────────────────────────────────|

The bucket name needs no longer be returned, since it is the same as the sample name. And for now the status field will always be success since if a request fails then an error is returned before any output.

Westwooo avatar Mar 25 '24 09:03 Westwooo