3#if KCH_PQXX_MAJOR_VERSION < 7
4#include <pqxx/binarystring>
8pqxx::binarystring
to_binstr(
const std::vector<std::uint8_t>& bytea)
10 return pqxx::binarystring{bytea.data(), bytea.size()};
13std::vector<std::uint8_t>
to_bytea(
const pqxx::binarystring& bstr)
15 std::vector<std::uint8_t> bytea;
16 bytea.reserve(bstr.size());
18 for (
const auto& ch : bstr)
19 bytea.push_back(
static_cast<std::uint8_t
>(ch));
std::vector< uint8_t > to_bytea(byte_string_view str)
Convert a byte string to a byte array.
pqxx::binarystring to_binstr(const std::vector< std::uint8_t > &bytea)
Convert a byte array to a binary string.