MySQL 8.4.2
Source Code Documentation
classic_query_param.h File Reference
#include <string>
#include <system_error>
#include "mysql/harness/stdx/expected.h"
#include "mysqlrouter/classic_protocol_message.h"

Go to the source code of this file.

Functions

stdx::expected< std::string, std::error_code > param_to_string (const classic_protocol::borrowed::message::client::Query::Param &param)
 convert any param-type into a human readable string. More...
 
stdx::expected< uint64_t, std::error_code > param_to_number (const classic_protocol::borrowed::message::client::Query::Param &param)
 convert a numeric type into an unsigned integer. More...
 
stdx::expected< std::string, std::error_code > param_as_string (const classic_protocol::borrowed::message::client::Query::Param &param)
 convert a string-typed query param to a std::string. More...
 

Function Documentation

◆ param_as_string()

stdx::expected< std::string, std::error_code > param_as_string ( const classic_protocol::borrowed::message::client::Query::Param param)

convert a string-typed query param to a std::string.

  • BLOB
  • TEXT
  • STRING
  • VARCHAR
  • VARSTRING

are string-types.

  • returns std::errc::bad_message if a non-string type is provided
  • returns a codec_errc if decoding the parameter fails.
Parameters
paramparameter of a query attribute
Returns
a std::string on success, a std::error_code on error.

◆ param_to_number()

stdx::expected< uint64_t, std::error_code > param_to_number ( const classic_protocol::borrowed::message::client::Query::Param param)

convert a numeric type into an unsigned integer.

◆ param_to_string()

stdx::expected< std::string, std::error_code > param_to_string ( const classic_protocol::borrowed::message::client::Query::Param param)

convert any param-type into a human readable string.