Skip to content

Conversation

@gulshan-123
Copy link
Contributor

@gulshan-123 gulshan-123 commented Jan 4, 2026

Fixes #6259

v.info -c format=csv is in sync with v.db.connect -c format=csv

GRASS nc_spm_08_grass7/PERMANENT:grass > v.db.connect bridges -c format=csv
name,sql_type
cat,INTEGER
OBJECTID,INTEGER
BRIDGES__1,DOUBLE PRECISION
SIPS_ID,CHARACTER
TYPE,CHARACTER
CLASSIFICA,CHARACTER
BRIDGE_NUM,DOUBLE PRECISION
FEATURE_IN,CHARACTER
FACILITY_C,CHARACTER
LOCATION,CHARACTER
YEAR_BUILT,DOUBLE PRECISION
WIDTH,DOUBLE PRECISION
CO_,DOUBLE PRECISION
CO_NAME,CHARACTER
GRASS nc_spm_08_grass7/PERMANENT:grass > v.info bridges -c format=csv
name,sql_type
cat,INTEGER
OBJECTID,INTEGER
BRIDGES__1,DOUBLE PRECISION
SIPS_ID,CHARACTER
TYPE,CHARACTER
CLASSIFICA,CHARACTER
BRIDGE_NUM,DOUBLE PRECISION
FEATURE_IN,CHARACTER
FACILITY_C,CHARACTER
LOCATION,CHARACTER
YEAR_BUILT,DOUBLE PRECISION
WIDTH,DOUBLE PRECISION
CO_,DOUBLE PRECISION
CO_NAME,CHARACTER

Errors when option and flags mismatch

GRASS nc_spm_08_grass7/PERMANENT:grass > v.info bridges -c format=shell
ERROR: format=shell is not valid with -c flag.
GRASS nc_spm_08_grass7/PERMANENT:grass > v.info bridges format=csv
ERROR: format=csv is only valid with -c flag.

Backward Compatibilty: with pipe as separator and header is skipped as with v.db.connect

GRASS nc_spm_08_grass7/PERMANENT:v.info > v.db.connect -c bridges
INTEGER|cat
INTEGER|OBJECTID
DOUBLE PRECISION|BRIDGES__1
CHARACTER|SIPS_ID
CHARACTER|TYPE
CHARACTER|CLASSIFICA
DOUBLE PRECISION|BRIDGE_NUM
CHARACTER|FEATURE_IN
CHARACTER|FACILITY_C
CHARACTER|LOCATION
DOUBLE PRECISION|YEAR_BUILT
DOUBLE PRECISION|WIDTH
DOUBLE PRECISION|CO_
CHARACTER|CO_NAME
GRASS nc_spm_08_grass7/PERMANENT:grass > v.info bridges -c
INTEGER|cat
INTEGER|OBJECTID
DOUBLE PRECISION|BRIDGES__1
CHARACTER|SIPS_ID
CHARACTER|TYPE
CHARACTER|CLASSIFICA
DOUBLE PRECISION|BRIDGE_NUM
CHARACTER|FEATURE_IN
CHARACTER|FACILITY_C
CHARACTER|LOCATION
DOUBLE PRECISION|YEAR_BUILT
DOUBLE PRECISION|WIDTH
DOUBLE PRECISION|CO_
CHARACTER|CO_NAME

@github-actions github-actions bot added vector Related to vector data processing C Related code is in C module labels Jan 4, 2026
@gulshan-123 gulshan-123 changed the title v.info: Add format=csv with -c flag and sync format=shell with v.db.connect v.info: Add format=csv with -c flag and sync with v.db.connect Jan 4, 2026
Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this looks good, please just fix the CI problems (-Werror=switch) and add a short test in test_vinfo.py.

@github-actions github-actions bot added Python Related code is in Python tests Related to Test Suite labels Jan 7, 2026
@gulshan-123
Copy link
Contributor Author

gulshan-123 commented Jan 7, 2026

Thank you. I have now fixed the CI error

I was curious how to identify that the failure was due to missing switch cases for NONE and CSV. You quickly pinpointed
-Werror=switch. Is this information directly visible in the CI logs or do we need to build grass with more flags?

EDIT: Thanks! I found it in CI logs, there is an option to search logs, as browser normal ctrl+F does not work!

@nilason
Copy link
Contributor

nilason commented Jan 7, 2026

Thank you. I have now fixed the CI error

I was curious how to identify that the failure was due to missing switch cases for NONE and CSV. You quickly pinpointed -Werror=switch. Is this information directly visible in the CI logs or do we need to build grass with more flags?

CIs are run with CFLAGS="-Wall -Wextra -Wpedantic -Wvla" CXXFLAGS="-Wall -Wextra -Wpedantic" and with -WError added to fail with any warning.

@gulshan-123 gulshan-123 requested a review from petrasovaa January 9, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Related code is in C module Python Related code is in Python tests Related to Test Suite vector Related to vector data processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] Sync JSON and CSV outputs of v.info -c to v.db.connect

3 participants