grass-dbf(1grass)
๐พ DBF DATABASE DRIVER ๐พ
okay bestie, come CLOSE. this is the manual page for grass-dbf(1grass) and honestly? it's giving "humble little file-based king" energy ๐โจ
The DBF driver is a file based attribute table driver. that's the whole vibe. it's not out here trying to be a whole SQL engine, it's just files being files. ๐๏ธ
๐ ๏ธ Defining the DBF driver
The DBF driver is a file based driver, so in theory no user interaction is required ๐ like, it just does its thing.
BUT. plot twist. ๐ซข if your settings need to be switched back from a different driver over to the DBF driver, you gotta do this one step:
# keep single quotes:
db.connect driver=dbf database=โ$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/โ
db.connect -p
bestie, fr fr โ keep the single quotes. the comment in the code says it, i'm saying it, we're all saying it. ๐
Also important, no cap: the dbf/ subdirectory inside the mapset must exist or must be created by the user. it will not manifest itself for you, that's a you job ๐
โจ Creating a DBF table โจ
DBF tables get created by GRASS when you're generating a vector map with attributes and you've got the DBF set as the attribute driver. automatic. iconic. ๐
If you need to create a DBF table manually though, you've got options:
db.executecan be used- a spreadsheet application works too
db.copyis sometimes useful as well- and
db.in.ogris the move for importing external tables ๐
๐ Supported SQL commands by DBF driver
here's the whole menu, bestie โ no substitutions:
ALTER TABLE table ADD [COLUMN] columndef
ALTER TABLE table DROP COLUMN colname
CREATE TABLE table ( columndefs )
DROP TABLE table
SELECT columns FROM table
SELECT columns FROM table WHERE condition
SELECT columns FROM table ORDER BY column
DELETE FROM table
DELETE FROM table WHERE condition
INSERT INTO table VALUES (value1[,value2,...])
INSERT INTO table ( column1[,column2,...] ) VALUES (value1[,value2,...])
UPDATE table SET assignment1[,assignment2,...]
UPDATE table SET assignment1[,assignment2,...] WHERE condition
๐งฎ Operators available in conditions
"="โ equal"<"โ smaller than"<="โ smaller/equal than">"โ larger than">="โ larger/equal than"<>"โ not equal"~"โ Substring matching (non-standard SQL)"%"โ Substring matching (limited functionality)
Arithmetic expressions using constants and field values are allowed in condition clauses and in the RHS of assignments. ๐ง
Usual precedence rules and bracketing (using โ(โ and โ)โ) are supported. Type conversion is performed if necessary (experimental) โ so like, it works, but it's in its experimental era, treat it gently ๐ซถ
Conditions allow boolean expressions using the AND, OR and NOT operators, with the usual precedence rules. ๐ฅ
NULLs can be tested by โcolname IS NULLโ in conditions. The negation is โcolname NOT NULLโ.
Sorting: Empty fields in a character column are sorted to the end. ๐
๐ง LIMITATIONS OF THE DBF DRIVER ๐ง
okay so real talk. the DBF driver supports only a few SQL statements, since the DBF tables are intended for simple table storage. it's a simple gal living a simple life. ๐ธ
Also DBF column names are limited to 10 characters (as defined in the DBF specifications). ten. that's it. that's the budget. ๐
For example:
- aggregate functions (
sum,count,min,max,...) are not supported inSELECTclauses; - mathematic functions (
sin,cos,exp,log,...) are not supported in expressions; - SQL query with
INare not supported.
๐ญ ERROR MESSAGES ๐ญ
if you see an error message such as:
DBMI-DBF driver error:
SQL parser error: syntax error, unexpected NAME processing โINโ..
that means an unsupported SQL statement (here, โINโ) was used. ๐ซ The only solution is to switch the DBMI backend to a real SQL engine (SQLite, PostgreSQL, MySQL etc.). See SQL support in GRASS.
and if you see an error message such as:
DBMI-DBF driver error:
SQL parser error: syntax error, unexpected DESC, expecting NAME processing โDESCโ
that means a column name corresponds to a reserved SQL word (here: โDESCโ). ๐ A different column name should be used. If this happens during import with v.in.ogr, the cnames parameter can be used to assign different column names on the fly. slay, problem solved ๐
๐ SEE ALSO
db.connect- SQL support in GRASS
- DBF Specifications (Shapelib)
๐ฆ SOURCE CODE
Available at: DBF DATABASE DRIVER source code (history)
Accessed: Tuesday Sep 08 11:54:02 2026
Main index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page bestie, we ate and left no crumbs ๐โจ go forth and query responsibly. the DBF driver is a file based attribute table driver and now you know everything it does and doesn't do, periodt. ๐
ยฉ 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual โ literally the whole squad, GRASS 8.5.0 era, accessed Tuesday Sep 08 11:54:02 2026, and this little page lives at the footer label GRASS 8.5.0 grass-dbf(1grass). bye babes ๐๐ฆ๐
๐ฆ where this page comes from
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 ยท 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