userver: uPg bytea support
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
uPg bytea support

The driver allows reading and writing raw binary data from/to PostgreSQL bytea type.

Reading and writing to PostgreSQL is implemented for std::string, std::string_view and std::vector of char or unsigned char.

Warning
When reading to std::string_view the value MUST NOT be used after the PostgreSQL result set is destroyed.
namespace pg = storages::postgres;
using namespace std::string_literals;
std::string s = "\0\xff\x0afoobar"s;
trx.Execute("select $1", pg::Bytea(tp));