-
-
Notifications
You must be signed in to change notification settings - Fork 401
db.columns: added support for -e to print more column information
#6933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like the compilation fails: |
|
Thank you for the review. I have taken all the suggestions. Also, I have added one test each for json and plain with -e flag. Also, one question: ~/grassdata/nc_spm_08_grass7/PERMANENT/vector$ ls
boundary_county busroutesall elev_lid792_randpts geology P079214 railroads swwake_10m
boundary_municp busstopsall elev_lidrural_mrpts geonames_NC P079215 roadsmajor urbanarea
bridges censusblk_swwake elev_lidrural_mrptsft geonames_wake P079218 schools_wake usgsgages
busroute1 census_wake2000 elev_ned10m_cont10m hospitals P079219 soils_general zipcodes_wake
busroute11 comm_colleges firestations lakes poi_names_wake soils_wake
busroute6 elev_lid792_bepts geodetic_pts nc_state precip_30ynormals streams
busroute_a elev_lid792_cont1m geodetic_swwake_pts overpasses precip_30ynormals_3d streets_wake |
The test data currently used is: |
|
One last thing, please add an example of the -e flag and json in the documentation (just the md file is enough). You can shorten the json output if it gets too long. Thank you! |
petrasovaa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
|
There seems to some maybe unrelated Linting error? Also, I am going ahead to add format=csv and format=list in db.columns as suggested in this comment of original issue: #6072 (comment) I think specifying option In list: (TYPE will be printed only in case of -e): default separator=newline eg. with sep=new line: In CSV:(if -e is not present, then, only name column will be printed) default separator=comma eg: Is this idea good? |
|
The linting error is fixed on main now |
Yes, you got it right. The idea with the plain vs list output is that the list output is parsable in command line and the format is part of API, while the plain output could potentially change. |

Towards #6072
Added a new flag -e, which will show more information about the column names, similar to v.info
The flag is supported for both plain and json format.
NOTE for reviewer: I have created a new if else condition based on -e flag, thus the older code for handling without -e flag is indented and is shown as red in the git diff.
But all the previous code is present. Thanks.