db.droptable
Drops an attribute table.
db.droptable [-f] [driver=name] [database=name] table=name [--verbose] [--quiet] [--qq] [--ui]
Example:
db.droptable table=name
grass.script.run_command("db.droptable", driver=None, database=None, table, flags=None, verbose=False, quiet=False, superquiet=False)
Example:
gs.run_command("db.droptable", table="name")
Parameters
driver=name
Name of database driver
If not given then default driver is used
database=name
Name of database
If not given then default database is used
table=name [required]
Name of table to drop
-f
Force removal (required for actual deletion of files)
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--qq
Very quiet module output
--ui
Force launching GUI dialog
driver : str, optional
Name of database driver
If not given then default driver is used
Used as: input, dbdriver, name
database : str, optional
Name of database
If not given then default database is used
Used as: input, dbname, name
table : str, required
Name of table to drop
Used as: input, dbtable, name
flags : str, optional
Allowed values: f
f
Force removal (required for actual deletion of files)
verbose: bool, optional
Verbose module output
Default: False
quiet: bool, optional
Quiet module output
Default: False
superquiet: bool, optional
Very quiet module output
Default: False
DESCRIPTION
db.droptable drops an attribute table. If the -f force flag is not given then nothing is removed, instead a preview of the action to be taken is printed.
NOTES
db.droptable is a front-end to db.execute to allow easier usage. To some extent it is verified if the table is connected to a vector map to avoid accidental table removal.
EXAMPLES
Removing an attribute table from default database
# show default database
db.connect -p
# show available tables
db.tables -p
# this will show what would happen
db.droptable table=sometable
# actually drop the table
db.droptable -f table=sometable
Removing an attribute table from given database
db.droptable allows defining optionally driver and database
options different from default connection settings (db.connect -p
).
# drop the table from SQLite database
db.droptable -f table=sometable driver=sqlite database=/opt/sqlite.db
SEE ALSO
db.dropdb, db.dropcolumn, db.execute, db.login, db.connect, db.tables, db.describe, v.db.droptable,
AUTHORS
Markus Neteler
Driver and database options added by Martin Landa, Czech Technical
University in Prague, Czech Republic
SOURCE CODE
Available at: db.droptable source code
(history)
Latest change: Wednesday Mar 12 22:27:28 2025 in commit 0095480