2 #include <grass/dbmi.h>
14 if (connection->driverName)
15 G_setenv2(
"DB_DRIVER", connection->driverName, G_VAR_MAPSET);
17 if (connection->databaseName)
18 G_setenv2(
"DB_DATABASE", connection->databaseName, G_VAR_MAPSET);
20 if (connection->schemaName)
21 G_setenv2(
"DB_SCHEMA", connection->schemaName, G_VAR_MAPSET);
23 if (connection->group)
24 G_setenv2(
"DB_GROUP", connection->group, G_VAR_MAPSET);
53 connection->driverName =
G__getenv2(
"DB_DRIVER", G_VAR_MAPSET);
54 connection->databaseName =
G__getenv2(
"DB_DATABASE", G_VAR_MAPSET);
55 connection->schemaName =
G__getenv2(
"DB_SCHEMA", G_VAR_MAPSET);
56 connection->group =
G__getenv2(
"DB_GROUP", G_VAR_MAPSET);
int G_setenv2(const char *name, const char *value, int loc)
Set environment variable from specific place.
char * G__getenv2(const char *name, int loc)
Get environment variable from specific place.
int db_get_connection(dbConnection *connection)
get default db connection settings
int db_set_connection(dbConnection *connection)
set default db connection settings