mysql/doc/qbk/helpers/StaticRow.qbk
2025-02-11 20:42:41 +01:00

41 lines
2.2 KiB
Plaintext

[/
Copyright (c) 2019-2025 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
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)
]
[section:boost__mysql__StaticRow StaticRow concept]
A `StaticRow` is a C++ type that can be used to model a row within the
static interface (i.e. can be passed as template parameter to
[reflink static_results] and [reflink static_execution_state]).
Formally, a type `T` is a `StaticRow` if either of the following is true:
* It is a non-const `struct` annotated with Boost.Describe data (i.e., having
`boost::describe::has_describe_members<T>::value == true`), and all the described
members fulfill the `ReadableField` exposition-only concept.
* It is a non-const `std::tuple` instantiation, and all of its types fulfill the
`ReadableField` exposition-only concept.
* It is an instantiation of the [reflink pfr_by_name] or [reflink pfr_by_position]
marker types using a type `Underlying` that satisfies the following:
* Is reflectable using Boost.PFR. For C++17 and later, this means
satisfying [@boost:/doc/html/boost_pfr/limitations_and_configuration.html `SimpleAggregate`].
For C++14, stricter requirements apply - see [@boost:/doc/html/boost_pfr/limitations_and_configuration.html the Boost.PFR docs]
for more info.
* Is a non-const object type (i.e. not a `union` or built-in type).
* All of its fields (as given by `pfr::structure_to_tuple`) satisfy `ReadableField`.
Note that row types with no fields (like empty Describe structs and empty tuples) are valid `StaticRow`s.
A `ReadableField` is C++ type that can be used to model a single value in a database row.
A type `F` is a `ReadableField` if it is any of the types listed
[link mysql.static_interface.readable_field_reference in this table]. The set of readable field types
is currently fixed and can't be extended by the user. If this is something you have interest in,
[@https://github.com/boostorg/mysql/issues/new please file an issue] with your use case to the repo.
The set of allowable types may be extended in future releases, both for fields and for rows.
[endsect]