GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71759
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
db/dbmi_base/connect.c File Reference

DBMI Library (base) - connect to DB. More...

#include <grass/gis.h>
#include <grass/dbmi.h>
Include dependency graph for db/dbmi_base/connect.c:

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. More...
 

Detailed Description

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.

Author
Joel Jones (CERL/UIUC), Radim Blazek
Doxygenized by Martin Landa <landa.martin gmail.com> (2011)

Definition in file db/dbmi_base/connect.c.

Function Documentation

int db_get_connection ( dbConnection connection)
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.

Parameters
connectionpointer to dbConnection with default settings
Returns
DB_OK

Definition at line 28 of file db/dbmi_base/connect.c.

References _db_connection::databaseName, DB_OK, _db_connection::driverName, G_setenv2(), G_VAR_MAPSET, _db_connection::group, and _db_connection::schemaName.

Referenced by db_set_default_connection().