Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards


Chapter 1. Boost.MySQL

Ruben Perez

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at

Table of Contents

Integrating Boost.MySQL into your project
Header-only mode
Separate compilation mode
Connection objects
Connection establishment
Text queries and prepared statements
The dynamic and the static interfaces
Prepared statements
Error handling
Asynchronous functions
Multi-function operations
The dynamic interface
The static interface
Text queries
Prepared statements
Multi-resultset: stored procedures and multi-queries
Multi-function operations
Going async
UNIX sockets and other stream types
Error handling and available overloads
Handshake parameters
Reconnecting a MySQL connection
Character sets
Time types: date, datetime and time
(Experimental) Type-erased connections with any_connection
(Experimental) Connection pools
(Experimental) Client-side SQL query formatting
(Experimental) Advanced client-side SQL query formatting
Async functions using callbacks
Async functions using futures
Async functions using stackful coroutines
Async functions using C++20 coroutines
Using prepared statements with the dynamic interface (C++11)
Using prepared statements with the static interface (C++14)
Using stored procedures with the dynamic interface (C++11)
Using stored procedures with the static interface (C++14)
UNIX sockets
Setting SSL options
Using multi-queries to source a .sql file
(Experimental) Using type-erased connections
(Experimental) Batch inserts using client-side query formatting
(Experimental) Generic batch inserts with Boost.Describe: extending format_sql
(Experimental) Dynamic filters using client-side query formatting
(Experimental) PATCH-like updates using client-side query formatting
(Experimental) Connection pools
Building and running the tests