userver
userver copied to clipboard
postgres::Row::operator[]
postgres::Row::operator[] accepts a const std::string& as an argument. A more idiomatic approach would be to accept a std::string_view instead, as implemented in userver for json and e.t.
Row::operator[](const std::string&)
eventually ends up in PQfnumber
which expects a null-terminated string, so for now there's no way to improve the interface, unfortunately.
However, we are planning to vendor libpq at some point, and when it happens we could add a PQfnumber
overload which accepts a string size.