GRASS Programmer's Manual
6.4.2(2012)
|
Functions | |
def | db_describe |
Return the list of columns for a database table (interface to `db.describe -c'). | |
def | db_connection |
Return the current database connection parameters (interface to `db.connect -p'). | |
def | db_select |
Perform SQL select statement. |
def python.db.db_connection | ( | ) |
Return the current database connection parameters (interface to `db.connect -p').
Example:
>>> grass.db_connection() {'group': 'x', 'schema': '', 'driver': 'dbf', 'database': '$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/'}
Definition at line 73 of file db.py.
References python::core.parse_key_val(), and python::core.read_command().
def python.db.db_describe | ( | table, | |
args | |||
) |
Return the list of columns for a database table (interface to `db.describe -c').
Example:
>>> grass.db_describe('lakes') {'nrows': 15279, 'cols': [['cat', 'INTEGER', '11'], ['AREA', 'DOUBLE PRECISION', '20'], ['PERIMETER', 'DOUBLE PRECISION', '20'], ['FULL_HYDRO', 'DOUBLE PRECISION', '20'], ['FULL_HYDR2', 'DOUBLE PRECISION', '20'], ['FTYPE', 'CHARACTER', '24'], ['FCODE', 'INTEGER', '11'], ['NAME', 'CHARACTER', '99']], 'ncols': 8}
table | table name |
args |
Definition at line 33 of file db.py.
References python::core.fatal(), and python::core.read_command().
def python.db.db_select | ( | table, | |
sql, | |||
file = False , |
|||
args | |||
) |
Perform SQL select statement.
table | table name |
sql | SQL select statement (string or file) |
file | True if sql is filename |
args | see db.select arguments |
Definition at line 87 of file db.py.
References python::core.fatal(), gui_modules::render.map, python::core.run_command(), and python::core.try_remove().