Now requires c++17. Headline: Easier, faster, neater: the transaction classes now have a stream method. You specify a query and the C++ types to which you want the fields converted, and you get to iterate over the rows. And thanks to C++14 structured bindings, you can read the fields straight into separate local variables: for (auto const [id, name]: tx.stream<int, std::string_view>("SELECT id, name FROM thing")) { process(id, name); } For super-fast access to a field's text-format contents, convert it to std::string_view. It'll give you an immediate reference to the buffer containing the field. Beware though: the buffer only holds that text for the one iteration. The next iteration will overwrite it. Full list of changes at: https://github.com/jtv/libpqxx/blob/7.1.2/NEWS |
||
---|---|---|
.. | ||
buildlink3.mk | ||
DESCR | ||
distinfo | ||
Makefile | ||
options.mk | ||
PLIST |