19 : m_auto_commit(true),
21 m_host_name(host_name),
22 m_user_name(user_name),
25 m_unix_socket(unix_socket) {}
71 const map_options_t::const_iterator value =
m_options.find(name);
74 return value ==
m_options.end() ?
"" : value->second;
103 return account_ref(
new account(host_name, user_name, password, schema, port, unix_socket));
const std::string option(const std::string &name) const
Gets the current value of any named option that was previously set.
const std::string & ssl_cipher() const
Gets the list of allowed SSL ciphers.
std::shared_ptr< account > account_ref
void clear_options()
Deletes all stored key/value pairs of named options.
void clear_connect_options()
Deletes all stored key/value pairs of named options.
void set_option(const std::string &name, const std::string &value)
Sets a named option key/value pair.
const std::string & unix_socket() const
Gets the unix socket path to connect to.
std::map< mysql_option, std::unique_ptr< option_arg > > map_connect_options_t
const std::string & password() const
Gets the password of the user to log in with.
u32 port() const
Gets the port to connect to.
account(const std::string &host_name, const std::string &user_name, const std::string &password, const std::string &schema, u32 port, const std::string &unix_sock)
Private account constructor.
bool store_result() const
Gets the current state of the store_result option.
std::string m_unix_socket
std::string m_ssl_certificate
const map_options_t & options() const
Gets a map of all option key/value pairs previously set.
const std::string & host_name() const
Gets the name of the host to connect to.
const std::string & ssl_ca() const
Gets the path to the certificate authority file.
map_connect_options_t m_connect_options
static account_ref create(const std::string &host_name, const std::string &user_name, const std::string &password, const std::string &schema="", u32 port=3306, const std::string &unix_socket="")
Create an account.
std::string m_ssl_ca_path
const map_connect_options_t & connect_options() const
Gets a map of all connect option key/value pairs previously set.
const std::string & ssl_ca_path() const
Gets the path to the directory containing CA files.
const std::string & schema() const
Gets the name of the database to open on connect.
std::string password(const std::string &server, const std::string &login)
void set_schema(const std::string &schema)
Sets the name of the database to open on connect.
std::map< std::string, std::string > map_options_t
void set_auto_commit(bool auto_commit)
Sets the state of the auto_commit option.
const std::string & ssl_certificate() const
Gets the path to the certificate file.
const std::string & ssl_key() const
Gets the path to the key file.
bool auto_commit() const
Gets the current state of the auto_commit option.
const std::string & user_name() const
Gets the username to log in with.
void set_ssl(const std::string &key, const std::string &certificate, const std::string &ca, const std::string &ca_path, const std::string &cipher)
Set SSL options.
void set_store_result(bool store_result)
Sets the state of the store_result option.
void set_connect_option(mysql_option option, bool arg)
Sets a connect option key/value pair with bool argument.