GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-d6dec75dd4
|
DBMI Library (base) - connect to DB. More...
Go to the source code of this file.
Functions | |
int | db_set_connection (dbConnection *connection) |
Set default DB connection settings. More... | |
int | db_get_connection (dbConnection *connection) |
Get default DB connection settings for the current mapset. More... | |
DBMI Library (base) - connect to DB.
(C) 1999-2009, 2011 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file db/dbmi_base/connect.c.
int db_get_connection | ( | dbConnection * | connection | ) |
Get default DB connection settings for the current mapset.
[out] | connection | pointer to dbConnection to be modified |
Definition at line 73 of file db/dbmi_base/connect.c.
References _db_connection::databaseName, DB_FAILED, db_get_login(), DB_OK, _db_connection::driverName, G_getenv_nofatal2(), G_VAR_MAPSET, G_zero(), _db_connection::group, _db_connection::hostName, NULL, _db_connection::password, _db_connection::port, _db_connection::schemaName, and _db_connection::user.
int db_set_connection | ( | dbConnection * | connection | ) |
Set default DB connection settings.
This function sets environmental variables as DB_DRIVER, DB_DATABASE, DB_SCHEMA, DB_GROUP.
connection | pointer to dbConnection with default settings |
Definition at line 28 of file db/dbmi_base/connect.c.
References _db_connection::databaseName, DB_OK, _db_connection::driverName, G_setenv2(), G_unsetenv2(), G_VAR_MAPSET, _db_connection::group, and _db_connection::schemaName.
Referenced by db_set_default_connection().