pgcli icon indicating copy to clipboard operation
pgcli copied to clipboard

Show status in csv format.

Open amjith opened this issue 3 years ago • 4 comments

Description

Show error status in CSV output format.

Checklist

  • [X] I've added this contribution to the changelog.rst.

amjith avatar May 23 '22 03:05 amjith

Codecov Report

Merging #1341 (318cdb9) into main (6884c29) will decrease coverage by 4.76%. The diff coverage is 23.48%.

@@            Coverage Diff             @@
##             main    #1341      +/-   ##
==========================================
- Coverage   84.15%   79.39%   -4.77%     
==========================================
  Files          21       24       +3     
  Lines        2720     2887     +167     
==========================================
+ Hits         2289     2292       +3     
- Misses        431      595     +164     
Impacted Files Coverage Δ
pgcli/pgtoolbar.py 31.57% <0.00%> (+0.15%) :arrow_up:
pgcli/pyev.py 15.38% <15.38%> (ø)
pgcli/explain_output_formatter.py 46.15% <46.15%> (ø)
pgcli/key_bindings.py 52.94% <50.00%> (-0.19%) :arrow_down:
pgcli/__init__.py 100.00% <100.00%> (ø)
pgcli/main.py 78.71% <100.00%> (+0.17%) :arrow_up:
pgcli/pgexecute.py 82.52% <100.00%> (+2.15%) :arrow_up:
pgcli/packages/prioritization.py 96.96% <0.00%> (-3.04%) :arrow_down:
pgcli/auth.py 91.30% <0.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 372da81...318cdb9. Read the comment docs.

codecov-commenter avatar May 23 '22 03:05 codecov-commenter

@amjith I thought we aren't displaying status in CSV intentionally, because it was breaking pspg pager. Can you explain why we need this now?

Edited: Got it, I now see the issue with visidata. Hmm. So what happens now with pspg?

j-bennet avatar Jun 08 '22 00:06 j-bennet

I believe pspg implemented a special flag to handle pgcli. --pgcli-fix

amjith avatar Jun 22 '22 05:06 amjith

So what happens now with pspg

FWIW, I'm happy with minimal configuration suggested at the end of the pgcli section:

pager = /usr/bin/pspg --rr=2 --quit-if-one-screen --ignore-case

I believe pspg implemented a special flag to handle pgcli: --pgcli-fix

Yes, but AFAICT that targets problems when using CSV output. Using the recommended table_format = psql it's not needed.

lelit avatar Jun 22 '22 06:06 lelit

@amjith I noticed that in this comment:

https://github.com/dbcli/pgcli/issues/1326#issuecomment-1162472608

the author says that even with this cnange, pgcli still doesn't behave the right way when displaying stderr, while litecli does. Do you know what is different?

j-bennet avatar Sep 16 '22 20:09 j-bennet