userver: uPg: Arrays
⚠️ 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: Arrays

uPg provides support for PostgreSQL arrays when the element type is supported by the driver, including user types.

Array parser will throw DimensionMismatch if the dimensions of C++ container do not match that of the buffer received from the server.

Array formatter will throw InvalidDimensions if containers on same level of depth have different sizes.

Example of invalid dimensions from tests:

static_test::two_dim_vector src{{1, 2, 3}, {4, 5}};
pg::test::Buffer buffer;
UEXPECT_THROW(io::WriteBuffer(types, buffer, src), pg::InvalidDimensions);
Currently supported containers
  • std::array
  • std::set
  • std::unordered_set
  • std::vector