MCPcopy Create free account
hub / github.com/acl-dev/acl / mysql_pool

Method mysql_pool

lib_acl_cpp/src/db/mysql_pool.cpp:15–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13{
14
15mysql_pool::mysql_pool(const char* dbaddr, const char* dbname,
16 const char* dbuser, const char* dbpass, int dblimit /* = 64 */,
17 unsigned long dbflags /* = 0 */, bool auto_commit /* = true */,
18 int conn_timeout /* = 60 */, int rw_timeout /* = 60 */,
19 const char* charset /* = "utf8" */)
20: db_pool(dbaddr, dblimit)
21{
22 acl_assert(dbaddr && *dbaddr);
23 acl_assert(dbname && *dbname);
24
25 conf_ = NEW mysql_conf(dbaddr, dbname);
26
27 if (dbuser && *dbuser) {
28 conf_->set_dbuser(dbuser);
29 }
30 if (dbpass && *dbpass) {
31 conf_->set_dbpass(dbpass);
32 }
33 if (charset && *charset) {
34 conf_->set_charset(charset);
35 }
36 conf_->set_dbflags(dbflags);
37 conf_->set_dblimit(dblimit);
38 conf_->set_auto_commit(auto_commit);
39 conf_->set_conn_timeout(conn_timeout);
40 conf_->set_rw_timeout(rw_timeout);
41}
42
43mysql_pool::mysql_pool(const mysql_conf& conf)
44: db_pool(conf.get_dbkey(), conf.get_dblimit())

Callers

nothing calls this directly

Calls 3

set_rw_timeoutMethod · 0.80
mysql_confClass · 0.50
set_charsetMethod · 0.45

Tested by

no test coverage detected