Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/mysql/connect_params.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // Copyright (c) 2019-2025 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 
0008 #ifndef BOOST_MYSQL_CONNECT_PARAMS_HPP
0009 #define BOOST_MYSQL_CONNECT_PARAMS_HPP
0010 
0011 #include <boost/mysql/any_address.hpp>
0012 #include <boost/mysql/ssl_mode.hpp>
0013 #include <boost/mysql/string_view.hpp>
0014 
0015 #include <cstdint>
0016 #include <string>
0017 
0018 namespace boost {
0019 namespace mysql {
0020 
0021 /**
0022  * \brief Parameters to be used with \ref any_connection connect functions.
0023  * \details
0024  * To be passed to \ref any_connection::connect and \ref any_connection::async_connect.
0025  * Includes the server address and MySQL handshake parameters. This is an owning type.
0026  */
0027 struct connect_params
0028 {
0029     /**
0030      * \brief Determines how to establish a physical connection to the MySQL server.
0031      * \details
0032      * This can be either a host and port or a UNIX socket path.
0033      * Defaults to (localhost, 3306).
0034      */
0035     any_address server_address;
0036 
0037     /// User name to authenticate as.
0038     std::string username;
0039 
0040     /// Password for that username, possibly empty.
0041     std::string password;
0042 
0043     /// Database name to use, or empty string for no database (this is the default).
0044     std::string database;
0045 
0046     /**
0047      * \brief The ID of the collation to use for the connection.
0048      * \details Impacts how text queries and prepared statements are interpreted. Defaults to
0049      * `utf8mb4_general_ci`, which is compatible with MySQL 5.x, 8.x and MariaDB.
0050      */
0051     std::uint16_t connection_collation{45};
0052 
0053     /**
0054      * \brief Controls whether to use TLS or not.
0055      * \details
0056      * See \ref ssl_mode for more information about the possible modes.
0057      * This option is only relevant when `server_address.type() == address_type::host_and_port`.
0058      * UNIX socket connections will never use TLS, regardless of this value.
0059      */
0060     ssl_mode ssl{ssl_mode::enable};
0061 
0062     /**
0063      * \brief Whether to enable support for executing semicolon-separated text queries.
0064      * \details Disabled by default.
0065      */
0066     bool multi_queries{false};
0067 };
0068 
0069 }  // namespace mysql
0070 }  // namespace boost
0071 
0072 #endif