74 return getenv(
"DB_USERNAME");
79 return getenv(
"DB_PASSWORD");
84 return getenv(
"DB_HOST");
89 return getenv(
"DB_NAME");
94 return getenv(
"DB_PORT");
124 if (name && !strlen(name)) name=NULL;
125 if (host && !strlen(host)) host=NULL;
126 if (port && !strlen(port)) port=NULL;
127 if (user && !strlen(user)) user=NULL;
128 if (pass && !strlen(pass)) pass=NULL;
131 if (!name || !pass || !user)
133 printf(
"Please run ./configure with --with-dbname, --with-dbuser, and --with-dbpass. "
134 "(--with-dbhost and --with-dbport are optional)\n");
138 (void) system(
"sh ./database_setup_mysql.sh setup");
141 printf(
"Please run ./configure with --with-dbname to indicate the location of a test database.\n");
145 (void) system(
"sh ./database_setup_sqlite3.sh setup");
150 status =
DbConnect(&handle, name, host, pass, user, port);
164 (void) system(
"sh ./database_setup_mysql.sh teardown");
166 (void) system(
"sh ./database_setup_sqlite3.sh teardown");