db.columns(1grass)

okay so we're doing db.columns(1grass) today, straight out of the GRASS User's Manual, and honestly? she's a little legend πŸ’–

🌈 NAME 🌈

db.columns β€” List all columns for a given table. that's it, that's the whole job, and she does it flawlessly ✨

πŸŽ€ KEYWORDS πŸŽ€

  • database
  • attribute table

✨ SYNOPSIS ✨

db.columns
db.columns --help
db.columns [-e] table=name  [driver=name]   [database=name]
[separator=character]  format=name  [--help]  [--verbose]  [--quiet]
[--ui]

πŸ’… Flags:

  • -e β€” Print type information about the columns. like, print the name and the type of all the columns for a given table. receipts included, bestie.
  • --help β€” Print usage summary
  • --verbose β€” Verbose module output
  • --quiet β€” Quiet module output
  • --ui β€” Force launching GUI dialog

πŸ¦‹ Parameters:

  • table=name [required] β€” Name of attribute table
  • driver=name β€” Name of database driver
    • Options: dbf, mysql, odbc, ogr, pg, sqlite
    • Default: sqlite
  • database=name β€” Name of database
    • Default: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db
  • separator=character β€” Field separator
    • Special characters: pipe, comma, space, tab, newline
  • format=name [required] β€” Output format
    • Options: plain, csv, json, list
    • Default: plain
    • plain: Configurable plain text output
    • csv: CSV (Comma Separated Values)
    • json: JSON (JavaScript Object Notation)
    • list: Output in list format

πŸ’œ DESCRIPTION πŸ’œ

db.columns lists all columns for a given table. no cap, that's the whole vibe. and the way she connects to databases? through the dbf, shp, odbc and pg drivers. iconic behavior, honestly. πŸ”₯

πŸ“Œ NOTE πŸ“Œ

if the parameters for your database connection are already set with db.connect, they get taken as default values β€” so you don't have to specify them every single time like it's your first day 😭 she remembers. she always remembers. 🫢

🌸 EXAMPLES 🌸

πŸ’– List columns of a PostgreSQL attribute table

db.columns table=zipcodes_wake driver=pg database=grassdb

and if the database parameters are already set, you can just list the columns directly like the main character you are:

db.columns table=zipcodes_wake

πŸ¦‹ List columns from Shape file with DBF attribute table

db.columns table=zipcodes_wake driver=dbf database=/grassdata/nc_spm_08/PERMANENT/dbf/

πŸ“ List columns of table in SQLite database

okay note this one down because it matters β€” the SQLite backend is the default setting. she's the default for a reason πŸ’…

db.columns driver=sqlite table=archsites database=’$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db’

πŸ”₯ SEE ALSO πŸ”₯

  • db.connect
  • db.describe
  • db.drivers
  • db.droptable
  • db.execute
  • db.login
  • db.tables
  • GRASS SQL interface
  • GRASS SQL interface
yes bestie, GRASS SQL interface is listed twice in the original. we keep it twice. we don't edit the queen's handwriting πŸ’€βœ¨

πŸ‘‘ AUTHOR πŸ‘‘

Radim Blazek, ITC-Irst, Trento, Italy 🌟

🧚 SOURCE CODE 🧚

Available at: db.columns source code (history)

Latest change: Saturday Jan 31 03:52:33 2026 in commit: 5dd1f9083055d3047f66dba6c3aec01c50dbdf2d

Main index | Database index | Topics index | Keywords index | Graphical index | Full index

Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual


and that's the whole page, bestie!! πŸŽ€ courtesy of GRASS 8.5.0, and yeah the footer literally just says db.columns(1grass) again because the manual loves a callback. go list some columns, you've got this πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from