Skip to content

db.columns: Add JSON support #6042

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

NishantBansal2003
Copy link
Contributor

Fixes: #6008

This PR adds JSON support to the db.columns module. The JSON output looks like:

[
    "cat",
    "OBJECTID",
    "WAKE_ZIPCO",
    "PERIMETER",
    "ZIPCODE_",
    "ZIPCODE_ID",
    "ZIPNAME",
    "ZIPNUM",
    "ZIPCODE",
    "NAME",
    "SHAPE_Leng",
    "SHAPE_Area",
]

This PR includes the following changes:

  1. Adds a format option with plain, and json modes for output formatting.
  2. Adds tests covering each of the new formats.
  3. Adds a Python example to the documentation for parsing JSON output.

Signed-off-by: Nishant Bansal <[email protected]>
@github-actions github-actions bot added Python Related code is in Python C Related code is in C database Related to database management module docs markdown Related to markdown, markdown files tests Related to Test Suite CMake labels Jul 7, 2025
@cwhite911 cwhite911 moved this to In Progress in GRASS JSON Outputs Jul 9, 2025
@cwhite911 cwhite911 added the gsoc Reserved for Google Summer of Code student(s) label Jul 9, 2025
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 CMake database Related to database management docs gsoc Reserved for Google Summer of Code student(s) markdown Related to markdown, markdown files module Python Related code is in Python tests Related to Test Suite
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

[Feat] Add JSON output to db.columns
2 participants