Skip to content

db.databases

Lists all databases for a given driver and location.

db.databases [driver=name] [location=name] [--verbose] [--quiet] [--qq] [--ui]

Example:

db.databases

grass.script.run_command("db.databases", driver="sqlite", location=None, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("db.databases")

Parameters

driver=name
    Name of database driver
    Allowed values: dbf, ogr, sqlite
    Default: sqlite
location=name
    Location
    Path for SQLite driver, or connection string for PostgreSQL driver
--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
    Used as: input, dbdriver, name
    Allowed values: dbf, ogr, sqlite
    Default: sqlite
location : str, optional
    Location
    Path for SQLite driver, or connection string for PostgreSQL driver
    Used as: name
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.databases lists all databases for a given driver and optionally location.

NOTES

Currently supported database drivers are SQLite, PostgreSQL, and ODBC.

Default location for SQLite driver is the full path for the current mapset. For PostgreSQL driver it's empty connection string.

EXAMPLES

List SQLite databases in the current mapset:

db.databases driver=sqlite

List SQLite databases in a given directory:

db.databases driver=sqlite location=/opt/sqlite

List PostgreSQL databases from database server running on given port:

db.databases driver=pg location="host=server_name port=5333"

SEE ALSO

db.columns, db.describe, db.drivers, db.execute, db.login, db.tables

GRASS SQL interface

AUTHORS

Radim Blazek, ITC-Irst, Trento, Italy
Updated for GRASS 7 by Martin Landa, Czech Technical University in Prague, Czech Republic

SOURCE CODE

Available at: db.databases source code (history)
Latest change: Friday Feb 07 19:16:09 2025 in commit a82a39f