Changeset 20055 for trunk/FACT++/src


Ignore:
Timestamp:
04/12/21 09:15:23 (4 years ago)
Author:
tbretz
Message:
Allow to output interpreted connection information for debugging purposes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Database.h

    r19435 r20055  
    2121    char compression;
    2222
    23     DatabaseName(const std::string &database) : compression(0)
     23    DatabaseName(const std::string &database, const bool &print=false) : compression(0)
    2424    {
    2525        if (database.empty())
     
    5050            port = 0;
    5151        }
     52
     53        if (print)
     54            std::cerr << "URI=" << user << ":" <<  passwd << "@" << server << ":" << port << "/" << db << "?compress=" << uint16_t(compression) << std::endl;
    5255    }
    5356
     
    6972{
    7073public:
    71     Database(const std::string &desc) : DatabaseName(desc),
     74    Database(const std::string &desc, const bool &print=false) : DatabaseName(desc, print),
    7275        mysqlpp::Connection()
    7376    {
     
    7679            set_option(new mysqlpp::CompressOption());
    7780
     81        //set_option(new mysqlpp::WriteTimeoutOption(3));
     82        //set_option(new mysqlpp::ReadTimeoutOption(28800));
    7883        set_option(new mysqlpp::ReconnectOption(true));
    7984
Note: See TracChangeset for help on using the changeset viewer.