#include <dbcontext_qsql.hpp>
|
static ContextQSql | fromEnv (const std::string host_env="HDS_DB_HOST", const std::string db_name_env="HDS_DB_NAME", const std::string user_env="HDS_DB_USER", const std::string passwd_env="HDS_DB_PASSWD") |
|
Database connection context
hds::db::ContextQSql::ContextQSql |
( |
| ) |
|
Default context.
host = "localhost" db_name = "hds" user = "root" passwd = <empty>
hds::db::ContextQSql::ContextQSql |
( |
const std::string & |
host, |
|
|
const std::string & |
db_name, |
|
|
const std::string & |
user, |
|
|
const std::string & |
passwd |
|
) |
| |
Constructor with context data provided.
- Parameters
-
host | Host name. |
db_name | Database name. |
user | Database user name. |
passwd | Database user password. |
const std::string& hds::db::ContextQSql::dbName |
( |
| ) |
const |
static ContextQSql hds::db::ContextQSql::fromEnv |
( |
const std::string |
host_env = "HDS_DB_HOST" , |
|
|
const std::string |
db_name_env = "HDS_DB_NAME" , |
|
|
const std::string |
user_env = "HDS_DB_USER" , |
|
|
const std::string |
passwd_env = "HDS_DB_PASSWD" |
|
) |
| |
|
static |
Return database context constructed from system enviroment.
Default context value assumed if any system variable not defined. Name of database host name system variable. Name of database system variable. Database user system variable. Database user password system variable.
- Returns
- database condext.
const std::string& hds::db::ContextQSql::host |
( |
| ) |
const |
const std::string& hds::db::ContextQSql::passwd |
( |
| ) |
const |
void hds::db::ContextQSql::setDbName |
( |
const std::string & |
db_name | ) |
|
void hds::db::ContextQSql::setHost |
( |
const std::string & |
host | ) |
|
void hds::db::ContextQSql::setPasswd |
( |
const std::string & |
passwd | ) |
|
void hds::db::ContextQSql::setUser |
( |
const std::string & |
user | ) |
|
const std::string& hds::db::ContextQSql::user |
( |
| ) |
const |
std::string hds::db::ContextQSql::m_db_name |
|
protected |
std::string hds::db::ContextQSql::m_host |
|
protected |
std::string hds::db::ContextQSql::m_passwd |
|
protected |
std::string hds::db::ContextQSql::m_user |
|
protected |
The documentation for this class was generated from the following file: