Boost C++ Libraries

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

This is the documentation for a snapshot of the master branch, built from commit 6149d39c9b.
Next

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 http://www.boost.org/LICENSE_1_0.txt)

Table of Contents

Introduction
Integrating Boost.MySQL into your project
Header-only mode
Separate compilation mode
Tutorial 1: hello world!
Tutorial 2: going async with C++20 coroutines
Tutorial 3: queries with parameters
Tutorial 4: the static interface
Tutorial 5: UPDATEs, transactions and semicolon-separated queries
Tutorial 6: Connection pools
Tutorial 7: Error handling
Overview
Connection establishment
Running queries
The dynamic and the static interfaces
Running INSERT, UPDATE and DELETE statements
Single outstanding async operation per connection
Error handling
Multi-function operations
Connection pools
Connection establishment and termination
Authentication
Connect with database
TLS support
UNIX sockets
Changing the network buffer size limit
Enabling multi-queries
Closing a connection
Reconnection and long-lived connections
Text queries and client-side SQL formatting
Using with_params for simple queries
Common errors and how to fix them
Prepared statements vs. client-side SQL formatting
Prepared statements
The dynamic interface
The static interface
Multi-resultset: stored procedures and multi-queries
Multi-function operations
Connection pools
Going async
Error handling and available overloads
Advanced client-side SQL query formatting
Formatting queries without executing them
Formatting ranges with sequence
Format specifiers
Extending format_sql
Types with built-in support for SQL formatting
Metadata
Character sets and collations
Time types: date, datetime and time
The legacy connection class
(Experimental) Pipelines
Examples
Tutorial 1 listing: hello world!
Tutorial 2 listing: going async with C++20 coroutines
Tutorial 3 listing: queries with parameters
Tutorial 4 listing: the static interface
Tutorial 5 listing: UPDATEs, transactions and multi-queries
Tutorial 6 listing: connection pools
Tutorial 7 listing: error handling
INSERTs, last_insert_id() and NULL values
DELETEs and affected_rows()
Prepared statements
Disabling TLS for a connection
Setting TLS options: enabling TLS certificate verification
Metadata
Reading rows in batches with multi-function operations
Callbacks (async functions in C++11)
Stackful coroutines (async functions in C++11)
UNIX sockets
Batch inserts using client-side query formatting
Generic batch inserts with Boost.Describe
Queries with dynamic filters
Dynamic UPDATE queries with PATCH-like semantics
Sourcing a .sql file using multi-queries
(Experimental) Pipelines
A REST API server that uses connection pooling
Reference

Next