59template <
class Typecode_tp, Typecode_tp typecode_end_tp>
60 requires requires { std::is_enum_v<Typecode_tp>; }
80template <
class Typecode_tp, Typecode_tp typecode_end_tp,
81 std::size_t column_count_tp>
83 std::array<Field_view_definition<Typecode_tp, typecode_end_tp>,
87template <
class Typecode_tp, Typecode_tp typecode_end_tp,
88 std::size_t column_count_tp>
89 requires requires { std::is_enum_v<Typecode_tp>; }
94template <
class Typecode_tp, Typecode_tp typecode_end_tp,
95 std::size_t column_count_tp>
139template <
class Typecode_tp, Typecode_tp typecode_end_tp,
140 std::size_t column_count_tp>
141 requires requires { std::is_enum_v<Typecode_tp>; }
170 for (
auto &field : row) {
191 if (null_field !=
nullptr) {
197 if (field ==
nullptr) {
203 switch (def.m_type) {
209 ->set_char_utf8mb4(target,
value, std::strlen(
value));
221 ->set2(target,
value);
225 unsigned long long value =
is_empty ? 0 : field->m_data.m_int;
Forward declaration.
Definition: row_proxy.h:142
void set_row(const typename Type_info_t::Row_t &row)
Make the proxy be a view over the given row.
Definition: row_proxy.h:168
Row_proxy(const typename Type_info_t::Row_view_definition_t &row_proxy_definition)
Construct a new Row_proxy for rows in a table whose schema is described by the given Type_info_t::Row...
Definition: row_proxy.h:156
void clear()
Make the proxy be a view over an "empty" row, which has NULL in all nullable fields and 0/"" in non-n...
Definition: row_proxy.h:164
void copy_field(int index, PSI_field *target) const
Copy the value of the given field of the current row to the target.
Definition: row_proxy.h:180
const Type_info_t::Row_view_definition_t & m_row_proxy_definition
Array where the Nth entry is the definition of the Nth column.
Definition: row_proxy.h:235
const Type_info_t::Field_t * m_field_by_typecode[Type_info_t::typecode_end]
Current map from m_type code to row value.
Definition: row_proxy.h:238
Ownership-agnostic array class, which is both trivial and standard-layout.
Definition: array_view.h:53
A type code and a value that is either a 64 bit integer, a boolean, or a bounded-length string.
Definition: field.h:48
Specifies macros to define Components.
#define SERVICE_PLACEHOLDER(service)
Use this macro to reference the service placeholder as defined by the REQUIRES_SERVICE_PLACEHOLDER ma...
Definition: component_implementation.h:381
bool is_empty(const std::string &str)
Definition: generic.h:34
bool index(const std::string &value, const String &search_for, uint32_t *idx)
Definition: contains.h:76
ValueType value(const std::optional< ValueType > &v)
Definition: gtid.h:83
bool is_null(poly_thread thread, poly_value value)
Definition: jit_executor_type_conversion.cc:46
struct PSI_field PSI_field
This is an opaque structure to denote field in plugin/component code.
Definition: pfs_plugin_table_service.h:93
REQUIRES_SERVICE_PLACEHOLDER(pfs_plugin_column_string_v2)
std::array< Field_view_definition< Typecode_tp, typecode_end_tp >, column_count_tp > Row_view_definition
Description of the mapping between columns and field typecodes, for all columns in a table.
Definition: row_proxy.h:84
Column_type
Framework that helps consuming data in a specific format, typically provided by a service API,...
Definition: row_proxy.h:43
@ timestamp_type
TIMESTAMP, stored in the backend data as microseconds in long long.
Definition: row_proxy.h:49
@ enum_type
ENUM, stored in the backend data as long long.
Definition: row_proxy.h:47
@ longlong_type
BIGINT, stored in the backend data as long long.
Definition: row_proxy.h:45
@ string_type
CHAR(...), stored as a char *.
Definition: row_proxy.h:51
Specifies macros to define Service Implementations.
Description of the mapping between a column and a field typecode.
Definition: row_proxy.h:61
Typecode_tp Typecode_t
Definition: row_proxy.h:62
static constexpr Typecode_t typecode_end
Definition: row_proxy.h:63
Typecode_t m_field_typecode
Enum value for the mysql::abi_helpers::Field object holding the value.
Definition: row_proxy.h:65
Column_type m_type
Type of the field.
Definition: row_proxy.h:67
Typecode_t m_null_typecode
Enum value for a mysql::abi_helpers::Field object that holds a bool indicating if the value is NULL.
Definition: row_proxy.h:75
Definition: pfs_plugin_table_service.h:124
Definition: pfs_plugin_table_service.h:130
Aggregates type definitions and constants for a given typecode enum, end element of that enum,...
Definition: row_proxy.h:96
Row_view_definition< Typecode_t, typecode_end, column_count > Row_view_definition_t
Definition: row_proxy.h:104
static constexpr std::size_t column_count
Definition: row_proxy.h:99
static constexpr Typecode_t typecode_end
Definition: row_proxy.h:98
Typecode_tp Typecode_t
Definition: row_proxy.h:97
std::string string_type
Definition: validate_password_imp.cc:85