|
libpqxx
The C++ client library for PostgreSQL
|
You cannot convert an unsigned char to/from SQL.
More...
#include <strconv.hxx>
Inheritance diagram for pqxx::string_traits< unsigned char >:
Collaboration diagram for pqxx::string_traits< unsigned char >:Additional Inherited Members | |
Static Public Member Functions inherited from pqxx::forbidden_conversion< unsigned char > | |
| static std::string_view | to_buf (std::span< char >, unsigned char const &, ctx={})=delete |
| static unsigned char | from_string (std::string_view, ctx={})=delete |
| static std::size_t | size_buffer (unsigned char const &) noexcept=delete |
You cannot convert an unsigned char to/from SQL.
Converting this type may seem simple enough, but it's ambiguous: Did you mean the char value as a small integer? Or were you thinking of a single-character string (and if so, using what encoding)? Or perhaps it's just a raw byte value?
If you meant it as an integer, use an appropriate integral type such as int or short or unsigned int etc.
If you wanted a single-character string, use std::string_view (or a similar type such as std::string).
Or if you had a raw byte in mind, try pqxx::bytes_view instead.