grass-sqlite(1)
π grass-sqlite(1) β the GRASS GIS User's Manual glow-up π
okay bestie, sit down, hydrate, and let me tell you about the SQLite DATABASE DRIVER π¦ because this one is genuinely the moment.
The SQLite driver is the default DBMI backend. yeah. the default. it's giving main character energy and it didn't even have to audition π
β¨ Creating a SQLite database β¨
GRASS is automatically creating the SQLite database if it is not yet existing when the first table is created in the SQLite database. that's right, it just does it for you, no cap π«Ά
It is sufficient to define the connection (see next step). literally that's it, that's the whole task π
πΈ Connecting GRASS to SQLite πΈ
The database name sqlite.db is at user's choice. pick your own name, go feral, live your truth β¨
Also the file storage location can be freely chosen. anywhere you want, bestie, the world is yours π
If the database does not exist, it will be automatically created when database content is created. so likeβ¦ don't stress about it not being there yet, it'll show up when it's needed π
# example for storing DB in mapset directory (keep single quotes):
db.connect driver=sqlite database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db'
db.connect -p
keep the single quotes fr fr, they are load-bearing π
and then db.connect -p to peek at your connection and vibe check it β
π Supported SQL commands π
All SQL commands supported by SQLite π (for limitations, see SQLite help page: SQL As Understood By SQLite and Unsupported SQL).
like. all of them. well, all the ones SQLite supports β check those two pages if you need the fine print, iykyk π
β Operators available in conditions β
All SQL operators supported by SQLite. yes queen, the whole set π₯
π¦ Browsing table data in DB π¦
A convenient SQLite front-end is sqlitebrowser. it's cute, it's visual, it's obsessed with you π₯°
To open a DB file stored within the current mapset, the following way is suggested (corresponds to above database connection):
# fetch GRASS variables as shell environment variables:
eval `g.gisenv`
# use double quotes:
sqlitebrowser "$GISDBASE/$LOCATION_NAME/$MAPSET"/sqlite/sqlite.db
note the plot twist: backticks on g.gisenv to pull those GRASS variables into your shell env, then double quotes for the path π the quotes change and honestly? iconic of them.
π SEE ALSO π
db.connectdb.executedb.select- SQL support in GRASS GIS
- SQLite web site
- SQLite manual
sqlite- Management Tools
π SOURCE CODE π
Available at: SQLite DATABASE DRIVER source code (history)
Accessed: Saturday Jan 17 05:40:32 2026
Main index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page bestie, you ate it up π
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
GRASS 8.4.2 β grass-sqlite(1) π¦ mwah, go create some tables, you've got this πβ¨π
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms