...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
A connection to MySQL over a UNIX domain socket.
Defined in header <boost/mysql/unix.hpp>
using unix_connection = connection< boost::asio::local::stream_protocol::socket >;
Name |
Description |
---|---|
The executor type associated to this object. |
|
Rebinds the connection type to another executor. |
|
The |
Name |
Description |
---|---|
Closes the connection to the server. |
|
Closes a statement, deallocating it from the server. |
|
Establishes a connection to a MySQL server. |
|
Executes a text query or prepared statement. |
|
Performs the MySQL-level handshake. |
|
Checks whether the server is alive. |
|
Prepares a statement server-side. |
|
Notifies the MySQL server that the client wants to end the session
and shutdowns SSL. |
|
Reads metadata for subsequent resultsets in a multi-resultset operation.
|
|
Reads a batch of rows. |
|
Resets server-side session state, like variables and prepared statements.
|
|
Starts a SQL execution as a multi-function operation. |
|
Closes the connection to the server. |
|
Closes a statement, deallocating it from the server. |
|
Establishes a connection to a MySQL server. |
|
Initializing constructor. |
|
Executes a text query or prepared statement. |
|
Retrieves the executor associated to this object. |
|
Performs the MySQL-level handshake. |
|
Returns the current metadata mode that this connection is using. |
|
Move assignment. |
|
Checks whether the server is alive. |
|
Prepares a statement server-side. |
|
Notifies the MySQL server that the client wants to end the session
and shutdowns SSL. |
|
Reads metadata for subsequent resultsets in a multi-resultset operation.
|
|
Reads a batch of rows. |
|
Resets server-side session state, like variables and prepared statements.
|
|
Sets the metadata mode. |
|
Starts a SQL execution as a multi-function operation. |
|
Retrieves the underlying Stream object. |
|
Returns whether the connection negotiated the use of SSL or not. |
Represents a connection to a MySQL server.
connection
is the main I/O
object that this library implements. It owns a Stream
object that is accessed by functions involving network operations, as well
as session state. You can access the stream using connection::stream
, and its executor via connection::get_executor
.
The executor used by this object is always the same as the underlying stream.
Distinct objects: safe.
Shared objects: unsafe.
This class is not thread-safe: for a single object, if you call its member functions concurrently from separate threads, you will get a race condition.