GRASS logo

SQLite driver in GRASS

Creating a SQLite database

A new database is created with 'sqlite3 test.db' (you can use a different database name if you like and also specify a path, i.e. store the database in the related mapset path), see the SQLite manual for details.

Connecting GRASS to SQLite

The table name 'sqlite.db' is at user's choice. Also the file storage location can be freely chosen.
# example for storing DB in mapset directory:
db.connect driver=sqlite database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db'
db.connect -p

Supported SQL commands

All SQL commands supported by SQLite.

Operators available in conditions

All SQL operators supported by SQLite.

Browsing table data in DB

A convenient SQLite front-end is sqlitebrowser. To open a DB file stored within the current mapset, the following way is suggested:
eval `g.gisenv`
sqlitebrowser "$GISDBASE/$LOCATION_NAME/$MAPSET"/sqlite.db

SEE ALSO

SQLite web site, db.execute, SQL support in GRASS GIS

Last changed: $Date$



Help Index