{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.oIjcHH2A/b1/libpqxx_7.10.0-2_amd64.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.oIjcHH2A/b2/libpqxx_7.10.0-2_amd64.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,5 +1,5 @@\n \n df166cacec29193b0480a38214ecff28 2528532 debug optional libpqxx-7.10-dbgsym_7.10.0-2_amd64.deb\n 3657c99010c390475028ad6cf5699c71 190056 libs optional libpqxx-7.10_7.10.0-2_amd64.deb\n 466e0d461e749d411abd629a4d76b74a 359052 libdevel optional libpqxx-dev_7.10.0-2_amd64.deb\n- 3725fc9305a24f3ea477b2d4b7ff46d8 2637492 doc optional libpqxx-doc_7.10.0-2_all.deb\n+ c915ce0ece89a05386cd3d18a65a5bf4 2637284 doc optional libpqxx-doc_7.10.0-2_all.deb\n"}, {"source1": "libpqxx-doc_7.10.0-2_all.deb", "source2": "libpqxx-doc_7.10.0-2_all.deb", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,3 +1,3 @@\n -rw-r--r-- 0 0 0 4 2025-01-23 16:15:05.000000 debian-binary\n--rw-r--r-- 0 0 0 32408 2025-01-23 16:15:05.000000 control.tar.xz\n--rw-r--r-- 0 0 0 2604892 2025-01-23 16:15:05.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 32344 2025-01-23 16:15:05.000000 control.tar.xz\n+-rw-r--r-- 0 0 0 2604748 2025-01-23 16:15:05.000000 data.tar.xz\n"}, {"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -391,15 +391,15 @@\n -rw-r--r-- 0 root (0) root (0) 9689 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/connection-sql__cursor_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 8829 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/connection-stream__from_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 8759 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/connection-stream__to_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 13910 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/connection-transaction_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 137398 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/connection_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 260956 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/conversions_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 59527 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/cursor_8hxx_source.html\n--rw-r--r-- 0 root (0) root (0) 36025 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/datatypes.html\n+-rw-r--r-- 0 root (0) root (0) 36027 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/datatypes.html\n -rw-r--r-- 0 root (0) root (0) 13989 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/dbtransaction_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 19653 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/deprecated.html\n -rw-r--r-- 0 root (0) root (0) 5222 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/dir_09456df80b5baeba1147d2b9ef5f002c.html\n -rw-r--r-- 0 root (0) root (0) 399 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/dir_09456df80b5baeba1147d2b9ef5f002c_dep.map\n -rw-r--r-- 0 root (0) root (0) 1857 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/dir_09456df80b5baeba1147d2b9ef5f002c_dep.png\n -rw-r--r-- 0 root (0) root (0) 11101 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/dir_3abbb4e2076021b5d2239498be5fcb30.html\n -rw-r--r-- 0 root (0) root (0) 1544 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/dir_3abbb4e2076021b5d2239498be5fcb30.js\n@@ -832,30 +832,30 @@\n -rw-r--r-- 0 root (0) root (0) 111 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/nav_hd.png\n -rw-r--r-- 0 root (0) root (0) 2167 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/navtree.css\n -rw-r--r-- 0 root (0) root (0) 15935 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/navtree.js\n -rw-r--r-- 0 root (0) root (0) 5968 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/navtreedata.js\n -rw-r--r-- 0 root (0) root (0) 19104 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/navtreeindex0.js\n -rw-r--r-- 0 root (0) root (0) 21285 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/navtreeindex1.js\n -rw-r--r-- 0 root (0) root (0) 19510 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/navtreeindex2.js\n--rw-r--r-- 0 root (0) root (0) 15191 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/navtreeindex3.js\n+-rw-r--r-- 0 root (0) root (0) 15193 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/navtreeindex3.js\n -rw-r--r-- 0 root (0) root (0) 17784 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/navtreeindex4.js\n--rw-r--r-- 0 root (0) root (0) 18021 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/navtreeindex5.js\n+-rw-r--r-- 0 root (0) root (0) 18019 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/navtreeindex5.js\n -rw-r--r-- 0 root (0) root (0) 2477 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/navtreeindex6.js\n -rw-r--r-- 0 root (0) root (0) 13256 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/nontransaction_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 16353 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/notification_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 122 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/open.png\n -rw-r--r-- 0 root (0) root (0) 6420 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/pages.html\n -rw-r--r-- 0 root (0) root (0) 12962 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/parameters.html\n -rw-r--r-- 0 root (0) root (0) 52695 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/params_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 5810 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/performance.html\n -rw-r--r-- 0 root (0) root (0) 29855 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/pipeline_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 696 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/plus.svg\n -rw-r--r-- 0 root (0) root (0) 696 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/plusd.svg\n -rw-r--r-- 0 root (0) root (0) 8893 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/pqxx-source_8hxx_source.html\n--rw-r--r-- 0 root (0) root (0) 14803 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/prepared.html\n+-rw-r--r-- 0 root (0) root (0) 14801 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/prepared.html\n -rw-r--r-- 0 root (0) root (0) 9364 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/prepared__statement_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 101844 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/range_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 5685 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/resize.js\n -rw-r--r-- 0 root (0) root (0) 8660 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/result-connection_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 11425 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/result-creation_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 8756 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/result-pipeline_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 8591 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/result-sql__cursor_8hxx_source.html\n@@ -865,34 +865,34 @@\n -rw-r--r-- 0 root (0) root (0) 19467 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/robusttransaction_8hxx_source.html\n -rw-r--r-- 0 root (0) root (0) 91997 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/row_8hxx_source.html\n drwxr-xr-x 0 root (0) root (0) 0 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/\n -rw-r--r-- 0 root (0) root (0) 7545 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_0.js\n -rw-r--r-- 0 root (0) root (0) 4729 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_1.js\n -rw-r--r-- 0 root (0) root (0) 6978 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_10.js\n -rw-r--r-- 0 root (0) root (0) 21620 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_11.js\n--rw-r--r-- 0 root (0) root (0) 7535 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_12.js\n+-rw-r--r-- 0 root (0) root (0) 7537 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_12.js\n -rw-r--r-- 0 root (0) root (0) 2857 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_13.js\n -rw-r--r-- 0 root (0) root (0) 906 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_14.js\n -rw-r--r-- 0 root (0) root (0) 1394 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_15.js\n -rw-r--r-- 0 root (0) root (0) 95 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_16.js\n -rw-r--r-- 0 root (0) root (0) 1207 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_17.js\n -rw-r--r-- 0 root (0) root (0) 319 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_18.js\n--rw-r--r-- 0 root (0) root (0) 15544 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_2.js\n+-rw-r--r-- 0 root (0) root (0) 15545 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_2.js\n -rw-r--r-- 0 root (0) root (0) 4603 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_3.js\n -rw-r--r-- 0 root (0) root (0) 9409 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_4.js\n -rw-r--r-- 0 root (0) root (0) 7171 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_5.js\n -rw-r--r-- 0 root (0) root (0) 5454 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_6.js\n -rw-r--r-- 0 root (0) root (0) 1038 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_7.js\n -rw-r--r-- 0 root (0) root (0) 5821 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_8.js\n -rw-r--r-- 0 root (0) root (0) 147 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_9.js\n -rw-r--r-- 0 root (0) root (0) 2895 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_a.js\n -rw-r--r-- 0 root (0) root (0) 1393 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_b.js\n--rw-r--r-- 0 root (0) root (0) 9602 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_c.js\n+-rw-r--r-- 0 root (0) root (0) 9603 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_c.js\n -rw-r--r-- 0 root (0) root (0) 9162 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_d.js\n--rw-r--r-- 0 root (0) root (0) 6430 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_e.js\n+-rw-r--r-- 0 root (0) root (0) 6428 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_e.js\n -rw-r--r-- 0 root (0) root (0) 4663 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/all_f.js\n -rw-r--r-- 0 root (0) root (0) 875 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/classes_0.js\n -rw-r--r-- 0 root (0) root (0) 1086 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/classes_1.js\n -rw-r--r-- 0 root (0) root (0) 975 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/classes_10.js\n -rw-r--r-- 0 root (0) root (0) 835 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/classes_11.js\n -rw-r--r-- 0 root (0) root (0) 157 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/classes_12.js\n -rw-r--r-- 0 root (0) root (0) 85 2025-01-23 16:15:05.000000 ./usr/share/doc/libpqxx-doc/doxygen-html/search/classes_13.js\n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/accessing-results.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/accessing-results.html", "unified_diff": "@@ -116,15 +116,15 @@\n

Three, when you convert a field to a \"view\" type (such as std::string_view or pqxx::bytes_view), the view points to underlying data which only stays valid until you iterate to the next row or exit the loop. So if you want to use that data for longer than a single iteration of the streaming loop, you'll have to store it somewhere yourself.

\n

Now for the good news. Streaming does make it very easy to query data and loop over it, and often faster than with the \"query\" or \"exec\" functions:

\n
for (auto [id, name, x, y] :
\n
tx.stream<int, std::string_view, float, float>(
\n
"SELECT id, name, x, y FROM point"))
\n
process(id + 1, "point-" + name, x * 10.0, y * 10.0);
\n

The conversion to C++ types (here int, std::string_view, and two floats) is built into the function. You never even see row objects, field objects, iterators, or conversion methods. You just put in your query and you receive your data.

\n-

\n+

\n Results with metadata

\n

Sometimes you want more from a query result than just rows of data. You may need to know right away how many rows of result data you received, or how many rows your UPDATE statement has affected, or the names of the columns, etc.

\n

For that, use the transaction's \"exec\" query execution functions. Apart from a few exceptions, these return a pqxx::result object. A result is a container of pqxx::row objects, so you can iterate them as normal, or index them like you would index an array. Each row in turn is a container of pqxx::field, Each field holds a value, but doesn't know its type. You specify the type when you read the value.

\n

For example, your code might do:

\n
pqxx::result r = tx.exec("SELECT * FROM mytable");
\n
for (auto const &row: r)
\n
{
\n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/binary.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/binary.html", "unified_diff": "@@ -103,15 +103,15 @@\n
std::string hi{"Hello binary world"};
\n
my_blob.write(pqxx::binary_cast(hi);
\n
bytes_view binary_cast(TYPE const &data)
Cast binary data to a type that libpqxx will recognise as binary.
Definition util.hxx:409
\n

The other takes a pointer and a size:

\n
char const greeting[] = "Hello binary world";
\n
char const *hi = greeting;
\n
my_blob.write(pqxx::binary_cast(hi, sizeof(greeting)));
\n-

\n+

\n Caveats

\n

There are some restrictions on binary_cast that you must be aware of.

\n

First, your data must of a type that gives us bytes. So: char, unsigned char, signed char, int8_t, uint8_t, or of course std::byte. You can't feed in a vector of double, or anything like that.

\n

Second, the data must be laid out as a contiguous block in memory. If there's no std::data() implementation for your type, it's not suitable.

\n

Third, binary_cast only constructs something like a std::string_view. It does not make a copy of your actual data. So, make sure that your data remains alive and in the same place while you're using it.

\n \n \n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1array__parser.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1array__parser.html", "unified_diff": "@@ -122,15 +122,15 @@\n  \n std::pair< juncture, std::string > get_next ()\n  Parse the next step in the array.
\n  \n \n

Detailed Description

\n

Low-level parser for C++ arrays.

\n-
Deprecated:
Use pqxx::array instead.
\n+
Deprecated:
Use pqxx::array instead.
\n

Clunky old API for parsing SQL arrays.

\n
Warning
This parser will only work reliably if your client encoding is UTF-8, ASCII, or a \"safe ASCII superset\" (such as the EUC encodings) where a byte value in the ASCII range can only occur as an actual ASCII character, never as one byte in a multi-byte character.
\n
\n The parser only supports array element types which use a comma (‘’,') as the separator between array elements. All built-in SQL types use comma, except forbox` which uses semicolon. However some custom types may not work.
\n

The input is a C-style string containing the textual representation of an array, as returned by the database. The parser reads this representation on the fly. The string must remain in memory until parsing is done.

\n

Parse the array by making calls to get_next until it returns a juncture of done. The juncture tells you what the parser found in that step: did the array \"nest\" to a deeper level, or \"un-nest\" back up?

\n

Member Enumeration Documentation

\n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1basic__fieldstream.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1basic__fieldstream.html", "unified_diff": "@@ -148,15 +148,15 @@\n \n  basic_fieldstream (field const &f)\n  \n \n

Detailed Description

\n
template<typename CHAR = char, typename TRAITS = std::char_traits<CHAR>>
\n class pqxx::basic_fieldstream< CHAR, TRAITS >

Input stream that gets its data from a result field.

\n-
Deprecated:
To convert a field's value string to some other type, e.g. to an int, use the field's as<...>() member function. To read a field efficiently just as a string, use its c_str() or its as<std::string_vview>().
\n+
Deprecated:
To convert a field's value string to some other type, e.g. to an int, use the field's as<...>() member function. To read a field efficiently just as a string, use its c_str() or its as<std::string_vview>().
\n

Works like any other istream to read data from a field. It supports all formatting and streaming operations of std::istream. For convenience there is a fieldstream alias, which defines a basic_fieldstream for char. This is similar to how e.g. std::ifstream relates to std::basic_ifstream.

\n

This class has only been tested for the char type (and its default traits).

\n

The documentation for this class was generated from the following file:\n \n \n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1basic__ilostream.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1basic__ilostream.html", "unified_diff": "@@ -151,15 +151,15 @@\n  basic_ilostream (dbtransaction &t, oid o, largeobject::size_type buf_size=512)\n  Create a basic_ilostream.
\n  \n \n

Detailed Description

\n
template<typename CHAR = char, typename TRAITS = std::char_traits<CHAR>>
\n class pqxx::basic_ilostream< CHAR, TRAITS >

Input stream that gets its data from a large object.

\n-
Deprecated:
Access large objects directly using the blob class.
\n+
Deprecated:
Access large objects directly using the blob class.
\n

This class worked like any other istream, but to read data from a large object. It supported all formatting and streaming operations of std::istream.

\n

This functionality was considered too fragile and complex, so it has been replaced with a single, much simpler class.

\n

Constructor & Destructor Documentation

\n \n

◆ basic_ilostream() [1/2]

\n \n
\n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1basic__lostream.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1basic__lostream.html", "unified_diff": "@@ -151,15 +151,15 @@\n  basic_lostream (dbtransaction &t, oid o, largeobject::size_type buf_size=512)\n  Create a basic_lostream.
\n  \n \n

Detailed Description

\n
template<typename CHAR = char, typename TRAITS = std::char_traits<CHAR>>
\n class pqxx::basic_lostream< CHAR, TRAITS >

Stream that reads and writes a large object.

\n-
Deprecated:
Access large objects directly using the blob class.
\n+
Deprecated:
Access large objects directly using the blob class.
\n

This worked like a std::iostream, but to read data from, or write data to, a large object. It supported all formatting and streaming operations of std::iostream.

\n

This functionality was considered too fragile and complex, so it has been replaced with a single, much simpler class.

\n

Constructor & Destructor Documentation

\n \n

◆ basic_lostream() [1/2]

\n \n
\n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1basic__olostream.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1basic__olostream.html", "unified_diff": "@@ -151,15 +151,15 @@\n  basic_olostream (dbtransaction &t, oid o, largeobject::size_type buf_size=512)\n  Create a basic_olostream.
\n  \n \n

Detailed Description

\n
template<typename CHAR = char, typename TRAITS = std::char_traits<CHAR>>
\n class pqxx::basic_olostream< CHAR, TRAITS >

Output stream that writes data back to a large object.

\n-
Deprecated:
Access large objects directly using the blob class.
\n+
Deprecated:
Access large objects directly using the blob class.
\n

This worked like any other ostream, but to write data to a large object. It supported all formatting and streaming operations of std::ostream.

\n

This functionality was considered too fragile and complex, so it has been replaced with a single, much simpler class.

\n

Constructor & Destructor Documentation

\n \n

◆ basic_olostream() [1/2]

\n \n
\n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1blob.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1blob.html", "unified_diff": "@@ -543,15 +543,15 @@\n \n inline \n \n \n
\n \n

Read up to std::size(buf) bytes from the object.

\n-
Deprecated:
As libpqxx moves to C++20 as its baseline language version, this will take and return std::span<std::byte>.
\n+
Deprecated:
As libpqxx moves to C++20 as its baseline language version, this will take and return std::span<std::byte>.
\n

Retrieves bytes from the blob, at the current position, until buf is full (i.e. its current size is reached), or there are no more bytes to read, whichever comes first.

\n

This function will not change either the size or the capacity of buf, only its contents.

\n

Returns the filled portion of buf. This may be empty.

\n \n
\n
\n \n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1connection.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1connection.html", "unified_diff": "@@ -788,15 +788,15 @@\n std::vector< pqxx::errorhandler * > pqxx::connection::get_errorhandlers \n (\n )\n const\n \n \n
\n-
Deprecated:
Return pointers to the active errorhandlers.
\n+
Deprecated:
Return pointers to the active errorhandlers.
\n

The entries are ordered from oldest to newest handler.

\n

The pointers point to the real errorhandlers. The container it returns however is a copy of the one internal to the connection, not a reference.

\n \n
\n \n \n

◆ get_notifs()

\n@@ -1528,15 +1528,15 @@\n )\n &\n \n \n
\n \n

Set session variable, using SQL's SET command.

\n-
Deprecated:
To set a session variable, use set_session_var. To set a transaction-local variable, execute an SQL SET command.
\n+
Deprecated:
To set a session variable, use set_session_var. To set a transaction-local variable, execute an SQL SET command.
\n
Warning
When setting a string value, you must escape and quote it first. Use the quote() function to do that.
\n
\n This executes an SQL query, so do not get or set variables while a table stream or pipeline is active on the same connection.
\n
Parameters
\n \n \n \n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1errorhandler.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1errorhandler.html", "unified_diff": "@@ -126,15 +126,15 @@\n \n \n \n
varVariable to set.
valueNew value for Var. This can be any SQL expression. If it's a string, be sure that it's properly escaped and quoted.

\n Friends

\n class internal::gate::errorhandler_connection
 
\n

Detailed Description

\n-
Deprecated:
Base class for obsolete error-handler callbacks.
\n+
Deprecated:
Base class for obsolete error-handler callbacks.
\n

This method of handling errors is obsolete. Use a \"notice handler\" instead.

\n
Warning
Strange things happen when a result object outlives its parent connection. If you register an error handler on a connection, then you must not access the result after destroying the connection. This applies even if you destroy the error handler first!
\n

Constructor & Destructor Documentation

\n \n

◆ errorhandler()

\n \n
\n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1internal_1_1dynamic__params.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1internal_1_1dynamic__params.html", "unified_diff": "@@ -123,15 +123,15 @@\n  \n \n constexpr auto access (decltype(*std::declval< IT >()) value) const -> decltype(std::declval< ACCESSOR >()(value))\n  \n \n

Detailed Description

\n
template<typename IT, typename ACCESSOR = decltype(iterator_identity<IT>)>
\n-class pqxx::internal::dynamic_params< IT, ACCESSOR >
Deprecated:
Use params instead.
\n+class pqxx::internal::dynamic_params< IT, ACCESSOR >
Deprecated:
Use params instead.
\n

Constructor & Destructor Documentation

\n \n

◆ dynamic_params() [1/2]

\n \n
\n
\n
\n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1largeobject.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1largeobject.html", "unified_diff": "@@ -171,15 +171,15 @@\n  \n \n PQXX_PRIVATE std::string reason (connection const &, int err) const\n  \n \n

Detailed Description

\n

Identity of a large object.

\n-
Deprecated:
Use the blob class instead.
\n+
Deprecated:
Use the blob class instead.
\n

Encapsulates the identity of a large object.

\n

A largeobject must be accessed only from within a backend transaction, but the object's identity remains valid as long as the object exists.

\n

Constructor & Destructor Documentation

\n \n

◆ largeobject() [1/5]

\n \n
\n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1largeobject__streambuf.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1largeobject__streambuf.html", "unified_diff": "@@ -190,15 +190,15 @@\n \n virtual int_type underflow () override\n  \n \n

Detailed Description

\n
template<typename CHAR = char, typename TRAITS = std::char_traits<CHAR>>
\n class pqxx::largeobject_streambuf< CHAR, TRAITS >

Streambuf to use large objects in standard I/O streams.

\n-
Deprecated:
Access large objects directly using the blob class.
\n+
Deprecated:
Access large objects directly using the blob class.
\n

The standard streambuf classes provide uniform access to data storage such as files or string buffers, so they can be accessed using standard input or output streams. This streambuf implementation provided similar access to large objects, so they could be read and written using the same stream classes.

\n

This functionality was considered too fragile and complex, so it has been replaced with a single, much simpler class.

\n

Member Data Documentation

\n \n

◆ default_mode

\n \n
\n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1largeobjectaccess.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1largeobjectaccess.html", "unified_diff": "@@ -238,15 +238,15 @@\n  \n bool operator>= (largeobject const &other) const\n  Compare object identities.
\n  \n \n

Detailed Description

\n

Accessor for large object's contents.

\n-
Deprecated:
Use the blob class instead.
\n+
Deprecated:
Use the blob class instead.
\n

Member Typedef Documentation

\n \n

◆ openmode

\n \n
\n
\n \n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1params.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1params.html", "unified_diff": "@@ -181,15 +181,15 @@\n \n \n \n \n \n
(binarystring const & value) &
\n
\n-
Deprecated:
Append binarystring parameter.
\n+
Deprecated:
Append binarystring parameter.
\n

The binarystring must stay valid for as long as the params remains active.

\n \n
\n
\n \n

◆ append() [2/6]

\n \n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1quiet__errorhandler.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1quiet__errorhandler.html", "unified_diff": "@@ -137,15 +137,15 @@\n  errorhandler (errorhandler const &)=delete\n  \n \n errorhandleroperator= (errorhandler const &)=delete\n  \n \n

Detailed Description

\n-
Deprecated:
Use a notice handler instead.
\n+
Deprecated:
Use a notice handler instead.
\n

Member Function Documentation

\n \n

◆ operator()()

\n \n
\n
\n \n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1row.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1row.html", "unified_diff": "@@ -497,15 +497,15 @@\n \n \n \n \n
) const
\n
\n

Produce a slice of this row, containing the given range of columns.

\n-
Deprecated:
I haven't heard of anyone caring about row slicing at all in at least the last 15 years. Yet it adds complexity, so unless anyone files a bug explaining why they really need this feature, I'm going to remove it. Even if they do, the feature may need an update.
\n+
Deprecated:
I haven't heard of anyone caring about row slicing at all in at least the last 15 years. Yet it adds complexity, so unless anyone files a bug explaining why they really need this feature, I'm going to remove it. Even if they do, the feature may need an update.
\n

The slice runs from the range's starting column to the range's end column, exclusive. It looks just like a normal result row, except slices can be empty.

\n \n
\n
\n \n

◆ table_column()

\n \n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1stream__from.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1stream__from.html", "unified_diff": "@@ -209,15 +209,15 @@\n  \n static stream_from table (transaction_base &tx, table_path path, std::initializer_list< std::string_view > columns={})\n  Factory: Stream data from a given table.
\n  \n \n

Detailed Description

\n

Stream data from the database.

\n-
Deprecated:
Use transaction_base::stream.
\n+
Deprecated:
Use transaction_base::stream.
\n

For larger data sets, retrieving data this way is likely to be faster than executing a query and then iterating and converting the rows fields. You will also be able to start processing before all of the data has come in.

\n

There are also downsides. Not all kinds of query will work in a stream. But straightforward SELECT and UPDATE ... RETURNING queries should work. This function makes use of pqxx::stream_from, which in turn uses PostgreSQL's COPY command, so see the documentation for those to get the full details.

\n

There are other downsides. If there stream encounters an error, it may leave the entire connection in an unusable state, so you'll have to give the whole thing up. Finally, opening a stream puts the connection in a special state, so you won't be able to do many other things with the connection or the transaction while the stream is open.

\n

There are two ways of starting a stream: you stream either all rows in a table (using one of the factories, table() or raw_table()), or the results of a query (using the query() factory).

\n

Usually you'll want the stream convenience wrapper in transaction_base, * so you don't need to deal with this class directly.

\n
Warning
While a stream is active, you cannot execute queries, open a pipeline, etc. on the same transaction. A transaction can have at most one object of a type derived from pqxx::transaction_focus active on it at a time.
\n

Constructor & Destructor Documentation

\n@@ -250,15 +250,15 @@\n )\n \n \n \n
\n \n

Execute query, and stream over the results.

\n-
Deprecated:
Use factory function query instead.
\n+
Deprecated:
Use factory function query instead.
\n \n
\n
\n \n

◆ stream_from() [2/7]

\n \n
\n@@ -287,15 +287,15 @@\n )\n \n \n \n
\n \n

Stream all rows in table, all columns.

\n-
Deprecated:
Use factories table or raw_table instead.
\n+
Deprecated:
Use factories table or raw_table instead.
\n \n
\n
\n \n

◆ stream_from() [3/7]

\n \n
\n@@ -346,15 +346,15 @@\n \n inline \n \n \n
\n \n

Stream given columns from all rows in table.

\n-
Deprecated:
Use factories table or raw_table instead.
\n+
Deprecated:
Use factories table or raw_table instead.
\n \n
\n
\n \n

◆ stream_from() [4/7]

\n \n
\n@@ -399,15 +399,15 @@\n \n inline \n \n \n
\n \n

Stream given columns from all rows in table.

\n-
Deprecated:
Use factory function query instead.
\n+
Deprecated:
Use factory function query instead.
\n \n
\n
\n \n

◆ stream_from() [5/7]

\n \n
\n@@ -436,15 +436,15 @@\n \n \n \n inline \n \n \n
\n-
Deprecated:
Use factories table or raw_table instead.
\n+
Deprecated:
Use factories table or raw_table instead.
\n \n
\n
\n \n

◆ stream_from() [6/7]

\n \n
\n@@ -481,15 +481,15 @@\n \n \n \n inline \n \n \n
\n-
Deprecated:
Use factories table or raw_table instead.
\n+
Deprecated:
Use factories table or raw_table instead.
\n \n
\n
\n \n

◆ stream_from() [7/7]

\n \n
\n@@ -524,15 +524,15 @@\n \n \n )\n \n \n \n
\n-
Deprecated:
Use factories table or raw_table instead.
\n+
Deprecated:
Use factories table or raw_table instead.
\n \n
\n
\n

Member Function Documentation

\n \n

◆ complete()

\n \n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1stream__to.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/classpqxx_1_1stream__to.html", "unified_diff": "@@ -218,15 +218,15 @@\n \n inline \n \n \n
\n \n

Create a stream, without specifying columns.

\n-
Deprecated:
Use table or raw_table as a factory.
\n+
Deprecated:
Use table or raw_table as a factory.
\n

Fields will be inserted in whatever order the columns have in the database.

\n

You'll probably want to specify the columns, so that the mapping between your data fields and the table is explicit in your code, and not hidden in an \"implicit contract\" between your code and your schema.

\n \n
\n \n \n

◆ stream_to() [2/2]

\n@@ -267,15 +267,15 @@\n \n inline \n \n \n
\n \n

Create a stream, specifying column names as a container of strings.

\n-
Deprecated:
Use table or raw_table as a factory.
\n+
Deprecated:
Use table or raw_table as a factory.
\n \n
\n \n

Member Function Documentation

\n \n

◆ complete()

\n \n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/datatypes.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/datatypes.html", "unified_diff": "@@ -93,52 +93,52 @@\n
Supporting additional data types
\n \n
\n

Communication with the database mostly happens in a text format. When you include an integer value in a query, either you use to_string to convert it to that text format, or under the bonnet, libpqxx does it for you. When you get a query result field \"as a float,\" libpqxx converts from the text format to a floating-point type. These conversions are everywhere in libpqxx.

\n

The conversion system supports many built-in types, but it is also extensible. You can \"teach\" libpqxx (in the scope of your own application) to convert additional types of values to and from PostgreSQL's string format.

\n

This is massively useful, but it's not for the faint of heart. You'll need to specialise some templates. And, the API for doing this can change with any major libpqxx release.

\n

If that happens, your code may fail to compile with the newer libpqxx version, and you'll have to go through the NEWS file to find the API changes. Usually it'll be a small change, like an additional function you need to implement, or a constant you need to define.

\n-

\n+

\n Converting types

\n

In your application, a conversion is driven entirely by a C++ type you specify. The value's SQL type on the database side has nothing to do with it. Nor is there anything in the string that would identify its type. Your code says \"convert to this type\" and libpqxx does it.

\n

So, if you've SELECTed a 64-bit integer from the database, and you try to convert it to a C++ short, one of two things will happen: either the number is small enough to fit in your short and it just works, or else it throws a conversion exception. Similarly, if you try to read a 32-bit SQL int as a C++ 32-bit unsigned int, that'll work fine, unless the value happens to be negative. In such cases the conversion will throw a conversion_error.

\n

Or, your database table might have a text column, but a given field may contain a string that looks just like a number. You can convert that value to an integer type just fine. Or to a floating-point type. All that matters to the conversion is the actual value, and the type your code specifies.

\n

In some cases the templates for these conversions can tell the type from the arguments you pass them:

\n
auto x = to_string(99);
\n

In other cases you may need to instantiate template explicitly:

\n
auto y = from_string<int>("99");
\n-

\n+

\n Supporting a new type

\n

Let's say you have some other SQL type which you want to be able to store in, or retrieve from, the database. What would it take to support that?

\n

Sometimes you do not need complete support. You might need a conversion to a string but not from a string, for example. You write out the conversion at compile time, so don't be too afraid to be incomplete. If you leave out one of these steps, it's not going to crash at run time or mess up your data. The worst that can happen is that your code won't build.

\n

So what do you need for a complete conversion?

\n

First off, of course, you need a C++ type. It may be your own, but it doesn't have to be. It could be a type from a third-party library, or even one from the standard library that libpqxx does not yet support.

\n

First thing to do is specialise the pqxx::type_name variable to give the type a human-readable name. That allows libpqxx error messages and such to talk about the type. If you don't define a name, libpqxx will try to figure one out with some help from the compiler, but it may not always be easy to read.

\n

Then, does your type have a built-in null value? For example, a char * can be null on the C++ side. Or some types are always null, such as nullptr. You specialise the pqxx::nullness template to specify the details.

\n

Finally, you specialise the pqxx::string_traits template. This is where you define the actual conversions.

\n

Let's go through these steps one by one.

\n-

\n+

\n Your type

\n

You'll need a type for which the conversions are not yet defined, because the C++ type is what determines the right conversion. One type, one set of conversions.

\n

The type doesn't have to be one that you create. The conversion logic was designed such that you can build it around any type. So you can just as easily build a conversion for a type that's defined somewhere else. There's no need to include any special methods or other members inside the type itself. That's also why libpqxx can convert built-in types like int.

\n

By the way, if the type is an enum, you don't need to do any of this. Just invoke the preprocessor macro PQXX_DECLARE_ENUM_CONVERSION, from the global namespace near the top of your translation unit, and pass the type as an argument.

\n

The library also provides specialisations for std::optional<T>, std::shared_ptr<T>, and std::unique_ptr<T>. If you have conversions for T, you'll also automatically have conversions for those.

\n-

\n+

\n Specialise <tt>type_name</tt>

\n

When errors happen during conversion, libpqxx will compose error messages for the user. Sometimes these will include the name of the type that's being converted.

\n

To tell libpqxx the name of each type, there's a template variable called pqxx::type_name. For any given type T, it should have a specialisation that provides that T's human-readable name:

\n
// T is your type.
\n
namespace pqxx
\n
{
\n
template<> std::string const type_name<T>{"My T type's name"};
\n
}
\n
The home of all libpqxx classes, functions, templates, etc.
Definition array.cxx:27
\n

(Yes, this means that you need to define something inside the pqxx namespace. Future versions of libpqxx may move this into a separate namespace.)

\n

Define this early on in your translation unit, before any code that might cause libpqxx to need the name. That way, the libpqxx code which needs to know the type's name can see your definition.

\n-

\n+

\n Specialise <tt>nullness</tt>

\n

A struct template pqxx::nullness defines whether your type has a natural \"null value\" built in. If so, it also provides member functions for producing and recognising null values.

\n

The simplest scenario is also the most common: most types don't have a null value built in. There is no \"null `int`\" in C++. In that kind of case, just derive your nullness traits from pqxx::no_null as a shorthand:

\n
// T is your type.
\n
namespace pqxx
\n
{
\n
template<> struct nullness<T> : pqxx::no_null<T> {};
\n@@ -172,15 +172,15 @@\n
}
\n
static bool is_null(TYPE const &value)
Is value a null?
\n
static TYPE null()
Return a null value.
\n
static bool has_null
Does this type have a null value?
Definition strconv.hxx:93
\n
static bool always_null
Is this type always null?
Definition strconv.hxx:96
\n

You may be wondering why there's a function to produce a null value, but also a function to check whether a value is null. Why not just compare the value to the result of null()? Because two null values may not be equal (like in SQL, where NULL <> NULL). Or T may have multiple different null values. Or T may override the comparison operator to behave in some unusual way.

\n

As a third case, your type may be one that always represents a null value. This is the case for std::nullptr_t and std::nullopt_t. In that case, you set nullness<TYPE>::always_null to true (as well as has_null of course), and you won't need to define any actual conversions.

\n-

\n+

\n Specialise <tt>string_traits</tt>

\n

This part is the most work. You can skip it for types that are always null, but those will be rare.

\n

The APIs for doing this are designed so that you don't need to allocate memory on the free store, also known as \"the heap\": new/delete. Memory allocation can be hidden inside std::string, std::vector, etc. The conversion API allows you to use std::string for convenience, or memory buffers for speed.

\n

Start by specialising the pqxx::string_traits template. You don't absolutely have to implement all parts of this API. Generally, if it compilers, you're OK for the time being. Just bear in mind that future libpqxx versions may change the API \u2014 or how it uses the API internally.

\n
namespace pqxx
\n
{
\n
// T is your type.
\n@@ -211,22 +211,22 @@\n
static TYPE from_string(std::string_view text)
Parse a string representation of a TYPE value.
\n
static std::size_t size_buffer(TYPE const &value) noexcept
Estimate how much buffer space is needed to represent value.
\n
static zview to_buf(char *begin, char *end, TYPE const &value)
Return a string_view representing value, plus terminating zero.
\n
static constexpr bool converts_to_string
Is conversion from TYPE to strings supported?
Definition strconv.hxx:159
\n
static char * into_buf(char *begin, char *end, TYPE const &value)
Write value's string representation into buffer at begin.
\n
static constexpr bool converts_from_string
Is conversion from string_view to TYPE supported?
Definition strconv.hxx:165
\n

You'll also need to write those member functions, or as many of them as needed to get your code to build.

\n-

\n+

\n <tt>from_string</tt>

\n

We start off simple: from_string parses a string as a value of T, and returns that value.

\n

The string may or may not be zero-terminated; it's just the string_view from beginning to end (with end being exclusive). In your tests, be sure to cover cases where the string does not end in a zero byte!

\n

It's perfectly possible that the string doesn't actually represent a T value. Mistakes happen. There can be corner cases. When you run into this, throw a pqxx::conversion_error.

\n

(Of course it's also possible that you run into some other error, so it's fine to throw different exceptions as well. But when it's definitely \"this is not\n the right format for a `T`,\" throw conversion_error.)

\n-

\n+

\n <tt>to_buf</tt>

\n

In this function, you convert a value of T into a string that the postgres server will understand.

\n

The caller will provide you with a buffer where you can write the string, if you need it: from begin to end exclusive. It's a half-open interval, so don't access *end.

\n

If the buffer is insufficient for you to do the conversion, throw a pqxx::conversion_overrun. It doesn't have to be exact: you can be a little pessimistic and demand a bit more space than you need. Just be sure to throw the exception if there's any risk of overrunning the buffer.

\n

You don't have to use the buffer for this function though. For example, pqxx::string_traits<bool>::to_buf returns a compile-time constant string and completely ignores the buffer.

\n

Even if you do use the buffer, your string does not have to start at the beginning of the buffer. For example, the integer conversions may work from right to left, if that's easier: they can start by writing the least significant digit to the end of the buffer, divide the remainder by 10, and repeat for the next digit.

\n

Return a pqxx::zview. This is basically a std::string_view, but with one difference: when you create a zview you guarantee that there is a valid zero byte right after the string_view. The zero byte does not count as part of its size, but it has to be there.

\n@@ -234,36 +234,36 @@\n
void invariant(zview z)
\n
{
\n
assert(z[std::size(z)] == 0);
\n
}
\n

The trailing zero should not go inside the zview, but if you convert into the buffer, do make sure you that trailing stays inside the buffer, i.e. before the end. (If there's no room for that zero inside the buffer, throw pqxx::conversion_error).

\n

Beware of locales when converting. If you use standard library features like sprintf, they may obey whatever locale is currently set on the system where the code runs. That means that a simple integer like 1000000 may come out as \"1000000\" on your system, but as \"1,000,000\" on mine, or as \"1.000.000\" for somebody else, and on an Indian system it may be \"1,00,000\". Don't let that happen, or it will confuse things. Use only non-locale-sensitive library functions. Values coming from or going to the database should be in fixed, non-localised formats.

\n

If your conversions need to deal with fields in types that libpqxx already supports, you can use the conversion functions for those: pqxx::from_string, pqxx::to_string, pqxx::to_buf. They in turn will call the string_traits specialisations for those types. Or, you can call their string_traits directly.

\n-

\n+

\n <tt>into_buf</tt>

\n

This is a stricter version of to_buf. All the same requirements apply, but in addition you must write your string into the given buffer, starting exactly at begin.

\n

That's why this function returns just a simple pointer: the address right behind the trailing zero. If the caller wants to use the string, they can find it at begin. If they want to write another value into the rest of the buffer, they can continue writing at the location you returned.

\n-

\n+

\n <tt>size_buffer</tt>

\n

Here you estimate how much buffer space you need for converting a T to a string. Be precise if you can, but pessimistic if you must. It's usually better to waste a few bytes of space than to spend a lot of time computing the exact buffer space you need. And failing the conversion because you under-budgeted the buffer is worst of all.

\n

Include the trailing zero in the buffer size. If your to_buf takes more space than just what's needed to store the result, include that too.

\n

Make size_buffer a constexpr function if you can. It can allow the caller to allocate the buffer on the stack, with a size known at compile time.

\n-

\n+

\n Optional: Specialise <tt>is_unquoted_safe</tt>

\n

When converting arrays or composite values to strings, libpqxx may need to quote values and escape any special characters. This takes time.

\n

Some types though, such as integral or floating-point types, can never have any special characters such as quotes, commas, or backslashes in their string representations. In such cases, there's no need to quote or escape such values in SQL arrays or composite types.

\n

If your type is like that, you can tell libpqxx about this by defining:

\n
namespace pqxx
\n
{
\n
// T is your type.
\n
template<> inline constexpr bool is_unquoted_safe<T>{true};
\n
}
\n

The code that converts this type of field to strings in an array or a composite type can then use a simpler, more efficient variant of the code. It's always safe to leave this out; it's just an optimisation for when you're completely sure that it's safe.

\n

Do not do this if a string representation of your type may contain a comma; semicolon; parenthesis; brace; quote; backslash; newline; or any other character that might need escaping.

\n-

\n+

\n Optional: Specialise <tt>param_format</tt>

\n

This one you don't generally need to worry about. Read on if you're writing a type which represents raw binary data, or if you're writing a template where some specialisations may contain raw binary data.

\n

When you call parameterised statements, or prepared statements with parameters, libpqxx needs to pass your parameters on to libpq, the underlying C-level PostgreSQL client library.

\n

There are two formats for doing that: text and binary. In the first, we represent all values as strings in the PostgreSQL text format, and the server then converts them into its own internal binary representation. That's what those string conversions above are all about, and it's what we do for almost all types of parameters.

\n

But we do it differently when the parameter is a contiguous series of raw bytes and the corresponding SQL type is BYTEA. There is a text format for those, but we bypass it for efficiency. The server can use the binary data in the exact same form, without any conversion or extra processing. The binary data is also twice as compact during transport.

\n

(People sometimes ask why we can't just treat all types as binary. However the general case isn't so clear-cut. The binary formats are not documented, there are no guarantees that they will be platform-independent or that they will remain stable across postgres releases, and there's no really solid way to detect when we might get the format wrong. On top of all that, the conversions aren't necessarily as straightforward and efficient as they sound. So, for the general case, libpqxx sticks with the text formats. Raw binary data alone stands out as a clear win.)

\n

Long story short, the machinery for passing parameters needs to know: is this parameter a binary string, or not? In the normal case it can assume \"no,\" and that's what it does. The text format is always a safe choice; we just try to use the binary format where it's faster.

\n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/deprecated.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/deprecated.html", "unified_diff": "@@ -91,89 +91,89 @@\n \n
\n
Deprecated List
\n
\n
\n
\n
Class pqxx::array_parser
\n-
Use pqxx::array instead.
\n+
Use pqxx::array instead.
\n
Class pqxx::basic_fieldstream< CHAR, TRAITS >
\n-
To convert a field's value string to some other type, e.g. to an int, use the field's as<...>() member function. To read a field efficiently just as a string, use its c_str() or its as<std::string_vview>().
\n+
To convert a field's value string to some other type, e.g. to an int, use the field's as<...>() member function. To read a field efficiently just as a string, use its c_str() or its as<std::string_vview>().
\n
Class pqxx::basic_ilostream< CHAR, TRAITS >
\n-
Access large objects directly using the blob class.
\n+
Access large objects directly using the blob class.
\n
Class pqxx::basic_lostream< CHAR, TRAITS >
\n-
Access large objects directly using the blob class.
\n+
Access large objects directly using the blob class.
\n
Class pqxx::basic_olostream< CHAR, TRAITS >
\n-
Access large objects directly using the blob class.
\n+
Access large objects directly using the blob class.
\n
Class pqxx::binarystring
\n-
Use bytes and bytes_view for binary data. In C++20 or better, any contiguous_range of std::byte will do.
\n+
Use bytes and bytes_view for binary data. In C++20 or better, any contiguous_range of std::byte will do.
\n
Member pqxx::blob::read (std::vector< std::byte, ALLOC > &buf)
\n-
As libpqxx moves to C++20 as its baseline language version, this will take and return std::span<std::byte>.
\n+
As libpqxx moves to C++20 as its baseline language version, this will take and return std::span<std::byte>.
\n
Member pqxx::connection::get_errorhandlers () const
\n-
Return pointers to the active errorhandlers.
\n+
Return pointers to the active errorhandlers.
\n
Member pqxx::connection::set_variable (std::string_view var, std::string_view value) &
\n-
To set a session variable, use set_session_var. To set a transaction-local variable, execute an SQL SET command.
\n+
To set a session variable, use set_session_var. To set a transaction-local variable, execute an SQL SET command.
\n
Member pqxx::connection_base
\n-
Old base class for connection. They are now the same class.
\n+
Old base class for connection. They are now the same class.
\n
Member pqxx::encrypt_password (zview user, zview password)
\n-
Use connection::encrypt_password instead.
\n+
Use connection::encrypt_password instead.
\n
Member pqxx::encrypt_password (char const user[], char const password[])
\n-
Use connection::encrypt_password instead.
\n+
Use connection::encrypt_password instead.
\n
Class pqxx::errorhandler
\n-
Base class for obsolete error-handler callbacks.
\n+
Base class for obsolete error-handler callbacks.
\n
Member pqxx::fieldstream
\n-
Read a field using field::as<...>() or field::c_str().
\n+
Read a field using field::as<...>() or field::c_str().
\n
Member pqxx::from_query
\n-
Use transaction_base::stream instead of stream_from.
\n+
Use transaction_base::stream instead of stream_from.
\n
Struct pqxx::from_query_t
\n-
Use stream_from::query() instead.
\n+
Use stream_from::query() instead.
\n
Member pqxx::from_table
\n-
Use transaction_base::stream instead of stream_from.
\n+
Use transaction_base::stream instead of stream_from.
\n
Struct pqxx::from_table_t
\n-
Use stream_from::table() instead.
\n+
Use stream_from::table() instead.
\n
Class pqxx::internal::dynamic_params< IT, ACCESSOR >
\n-
Use params instead.
\n+
Use params instead.
\n
Class pqxx::largeobject
\n-
Use the blob class instead.
\n+
Use the blob class instead.
\n
Class pqxx::largeobject_streambuf< CHAR, TRAITS >
\n-
Access large objects directly using the blob class.
\n+
Access large objects directly using the blob class.
\n
Class pqxx::largeobjectaccess
\n-
Use the blob class instead.
\n+
Use the blob class instead.
\n
Member pqxx::operator<< (std::basic_ostream< CHAR > &s, field const &value)
\n-
The C++ streams library is not great to work with. In particular, error handling is easy to get wrong. So you're probably better off doing this by hand.
\n+
The C++ streams library is not great to work with. In particular, error handling is easy to get wrong. So you're probably better off doing this by hand.
\n
Member pqxx::params::append (binarystring const &value) &
\n-
Append binarystring parameter.
\n+
Append binarystring parameter.
\n
Namespace pqxx::prepare
\n-
The new params class replaces all of this.
\n+
The new params class replaces all of this.
\n
Class pqxx::quiet_errorhandler
\n-
Use a notice handler instead.
\n+
Use a notice handler instead.
\n
Member pqxx::row::slice (size_type sbegin, size_type send) const
\n-
I haven't heard of anyone caring about row slicing at all in at least the last 15 years. Yet it adds complexity, so unless anyone files a bug explaining why they really need this feature, I'm going to remove it. Even if they do, the feature may need an update.
\n+
I haven't heard of anyone caring about row slicing at all in at least the last 15 years. Yet it adds complexity, so unless anyone files a bug explaining why they really need this feature, I'm going to remove it. Even if they do, the feature may need an update.
\n
Class pqxx::stream_from
\n-
Use transaction_base::stream.
\n-
Member pqxx::stream_from::stream_from (transaction_base &tx, std::string_view table)
\n-
Use factories table or raw_table instead.
\n+
Use transaction_base::stream.
\n+
Member pqxx::stream_from::stream_from (transaction_base &, from_query_t, std::string_view query)
\n+
Use factory function query instead.
\n
Member pqxx::stream_from::stream_from (transaction_base &, std::string_view table, Iter columns_begin, Iter columns_end)
\n-
Use factories table or raw_table instead.
\n+
Use factories table or raw_table instead.
\n
Member pqxx::stream_from::stream_from (transaction_base &tx, std::string_view table, Columns const &columns)
\n-
Use factories table or raw_table instead.
\n+
Use factories table or raw_table instead.
\n+
Member pqxx::stream_from::stream_from (transaction_base &tx, std::string_view table)
\n+
Use factories table or raw_table instead.
\n
Member pqxx::stream_from::stream_from (transaction_base &tx, from_table_t, std::string_view table, Columns const &columns)
\n-
Use factory function query instead.
\n+
Use factory function query instead.
\n
Member pqxx::stream_from::stream_from (transaction_base &, from_table_t, std::string_view table, Iter columns_begin, Iter columns_end)
\n-
Use factories table or raw_table instead.
\n+
Use factories table or raw_table instead.
\n
Member pqxx::stream_from::stream_from (transaction_base &, from_table_t, std::string_view table)
\n-
Use factories table or raw_table instead.
\n-
Member pqxx::stream_from::stream_from (transaction_base &, from_query_t, std::string_view query)
\n-
Use factory function query instead.
\n+
Use factories table or raw_table instead.
\n
Member pqxx::stream_to::stream_to (transaction_base &, std::string_view table_name, Columns const &columns)
\n-
Use table or raw_table as a factory.
\n+
Use table or raw_table as a factory.
\n
Member pqxx::stream_to::stream_to (transaction_base &tx, std::string_view table_name)
\n-
Use table or raw_table as a factory.
\n+
Use table or raw_table as a factory.
\n
Member pqxx::strip_t
\n-
In C++20 we'll replace this with std::remove_cvref.
\n+
In C++20 we'll replace this with std::remove_cvref.
\n
Member pqxx::transaction_base::set_variable (std::string_view var, std::string_view value)
\n
To set a transaction-local variable, execute an SQL SET command. To set a session variable, use the connection's set_session_var function.
\n
\n
\n
\n
\n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -67,35 +67,35 @@\n Member _\bp_\bq_\bx_\bx_\b:_\b:_\br_\bo_\bw_\b:_\b:_\bs_\bl_\bi_\bc_\be (size_type sbegin, size_type send) const\n I haven't heard of anyone caring about row slicing at all in at least the\n last 15 years. Yet it adds complexity, so unless anyone files a bug\n explaining why they really need this feature, I'm going to remove it.\n Even if they do, the feature may need an update.\n Class _\bp_\bq_\bx_\bx_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm\n Use _\bt_\br_\ba_\bn_\bs_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm.\n- Member _\bp_\bq_\bx_\bx_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm (_\bt_\br_\ba_\bn_\bs_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be &tx, std::string_view\n- table)\n- Use factories _\bt_\ba_\bb_\bl_\be or _\br_\ba_\bw_\b__\bt_\ba_\bb_\bl_\be instead.\n+ Member _\bp_\bq_\bx_\bx_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm (_\bt_\br_\ba_\bn_\bs_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be &, _\bf_\br_\bo_\bm_\b__\bq_\bu_\be_\br_\by_\b__\bt,\n+ std::string_view query)\n+ Use factory function _\bq_\bu_\be_\br_\by instead.\n Member _\bp_\bq_\bx_\bx_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm (_\bt_\br_\ba_\bn_\bs_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be &, std::string_view\n table, Iter columns_begin, Iter columns_end)\n Use factories _\bt_\ba_\bb_\bl_\be or _\br_\ba_\bw_\b__\bt_\ba_\bb_\bl_\be instead.\n Member _\bp_\bq_\bx_\bx_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm (_\bt_\br_\ba_\bn_\bs_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be &tx, std::string_view\n table, Columns const &columns)\n Use factories _\bt_\ba_\bb_\bl_\be or _\br_\ba_\bw_\b__\bt_\ba_\bb_\bl_\be instead.\n+ Member _\bp_\bq_\bx_\bx_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm (_\bt_\br_\ba_\bn_\bs_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be &tx, std::string_view\n+ table)\n+ Use factories _\bt_\ba_\bb_\bl_\be or _\br_\ba_\bw_\b__\bt_\ba_\bb_\bl_\be instead.\n Member _\bp_\bq_\bx_\bx_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm (_\bt_\br_\ba_\bn_\bs_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be &tx, _\bf_\br_\bo_\bm_\b__\bt_\ba_\bb_\bl_\be_\b__\bt,\n std::string_view table, Columns const &columns)\n Use factory function _\bq_\bu_\be_\br_\by instead.\n Member _\bp_\bq_\bx_\bx_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm (_\bt_\br_\ba_\bn_\bs_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be &, _\bf_\br_\bo_\bm_\b__\bt_\ba_\bb_\bl_\be_\b__\bt,\n std::string_view table, Iter columns_begin, Iter columns_end)\n Use factories _\bt_\ba_\bb_\bl_\be or _\br_\ba_\bw_\b__\bt_\ba_\bb_\bl_\be instead.\n Member _\bp_\bq_\bx_\bx_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm (_\bt_\br_\ba_\bn_\bs_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be &, _\bf_\br_\bo_\bm_\b__\bt_\ba_\bb_\bl_\be_\b__\bt,\n std::string_view table)\n Use factories _\bt_\ba_\bb_\bl_\be or _\br_\ba_\bw_\b__\bt_\ba_\bb_\bl_\be instead.\n- Member _\bp_\bq_\bx_\bx_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bf_\br_\bo_\bm (_\bt_\br_\ba_\bn_\bs_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be &, _\bf_\br_\bo_\bm_\b__\bq_\bu_\be_\br_\by_\b__\bt,\n- std::string_view query)\n- Use factory function _\bq_\bu_\be_\br_\by instead.\n Member _\bp_\bq_\bx_\bx_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bt_\bo_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bt_\bo (_\bt_\br_\ba_\bn_\bs_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be &, std::string_view\n table_name, Columns const &columns)\n Use _\bt_\ba_\bb_\bl_\be or _\br_\ba_\bw_\b__\bt_\ba_\bb_\bl_\be as a factory.\n Member _\bp_\bq_\bx_\bx_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bt_\bo_\b:_\b:_\bs_\bt_\br_\be_\ba_\bm_\b__\bt_\bo (_\bt_\br_\ba_\bn_\bs_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be &tx, std::string_view\n table_name)\n Use _\bt_\ba_\bb_\bl_\be or _\br_\ba_\bw_\b__\bt_\ba_\bb_\bl_\be as a factory.\n Member _\bp_\bq_\bx_\bx_\b:_\b:_\bs_\bt_\br_\bi_\bp_\b__\bt\n"}]}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/group__escaping-functions.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/group__escaping-functions.html", "unified_diff": "@@ -120,15 +120,15 @@\n \n \n \n \n
class pqxx::binarystring
\n
\n

Binary data corresponding to PostgreSQL's \"BYTEA\" binary-string type.

\n-
Deprecated:
Use bytes and bytes_view for binary data. In C++20 or better, any contiguous_range of std::byte will do.
\n+
Deprecated:
Use bytes and bytes_view for binary data. In C++20 or better, any contiguous_range of std::byte will do.
\n

This class represents a binary string as stored in a field of type bytea.

\n

Internally a binarystring is zero-terminated, but it may also contain null bytes, they're just like any other byte value. So don't assume that it's safe to treat the contents as a C-style string.

\n

The binarystring retains its value even if the result it was obtained from is destroyed, but it cannot be copied or assigned.

\n

To include a binarystring value in an SQL query, escape and quote it using the transaction's quote_raw function.

\n
Warning
This class is implemented as a reference-counting smart pointer. Copying, swapping, and destroying binarystring objects that refer to the same underlying data block is not thread-safe. If you wish to pass binarystrings around between threads, make sure that each of these operations is protected against concurrency with similar operations on the same object, or other objects pointing to the same data block.
\n
\n \n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/namespacepqxx.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/namespacepqxx.html", "unified_diff": "@@ -920,15 +920,15 @@\n

Public Types

\n \n \n \n
struct pqxx::from_query_t
\n
\n

Marker for stream_from constructors: \"stream from query.\".

\n-
Deprecated:
Use stream_from::query() instead.
\n+
Deprecated:
Use stream_from::query() instead.
\n
\n
\n \n \n

◆ pqxx::from_table_t

\n \n
\n@@ -936,15 +936,15 @@\n \n \n \n \n
struct pqxx::from_table_t
\n
\n

Marker for stream_from constructors: \"stream from table.\".

\n-
Deprecated:
Use stream_from::table() instead.
\n+
Deprecated:
Use stream_from::table() instead.
\n
\n
\n \n \n

◆ pqxx::notification

\n \n
\n@@ -1073,30 +1073,30 @@\n
\n \n \n \n \n
using pqxx::connection_base = typedef connection
\n
\n-
Deprecated:
Old base class for connection. They are now the same class.
\n+
Deprecated:
Old base class for connection. They are now the same class.
\n \n
\n
\n \n

◆ fieldstream

\n \n
\n
\n \n \n \n \n
using pqxx::fieldstream = typedef basic_fieldstream<char>
\n
\n-
Deprecated:
Read a field using field::as<...>() or field::c_str().
\n+
Deprecated:
Read a field using field::as<...>() or field::c_str().
\n \n
\n
\n \n

◆ strip_t

\n \n
\n@@ -1107,15 +1107,15 @@\n \n using pqxx::strip_t = typedef std::remove_cv_t<std::remove_reference_t<TYPE> >\n \n \n
\n \n

Remove any constness, volatile, and reference-ness from a type.

\n-
Deprecated:
In C++20 we'll replace this with std::remove_cvref.
\n+
Deprecated:
In C++20 we'll replace this with std::remove_cvref.
\n \n
\n \n \n

◆ table_path

\n \n
\n@@ -1486,15 +1486,15 @@\n )\n \n \n \n
\n \n

Encrypt a password.

\n-
Deprecated:
Use connection::encrypt_password instead.
\n+
Deprecated:
Use connection::encrypt_password instead.
\n \n
\n \n \n

◆ encrypt_password() [2/2]

\n \n
\n@@ -1525,15 +1525,15 @@\n \n inline \n \n \n
\n \n

Encrypt password.

\n-
Deprecated:
Use connection::encrypt_password instead.
\n+
Deprecated:
Use connection::encrypt_password instead.
\n \n
\n \n \n

◆ from_string()

\n \n
\n@@ -1701,15 +1701,15 @@\n \n inline \n \n \n
\n \n

Write a result field to any type of stream.

\n-
Deprecated:
The C++ streams library is not great to work with. In particular, error handling is easy to get wrong. So you're probably better off doing this by hand.
\n+
Deprecated:
The C++ streams library is not great to work with. In particular, error handling is easy to get wrong. So you're probably better off doing this by hand.
\n

This can be convenient when writing a field to an output stream. More importantly, it lets you write a field to e.g. a stringstream which you can then use to read, format and convert the field in ways that to() does not support.

\n

Example: parse a field into a variable of the nonstandard long long type.

\n
extern result R;
\n
long long L;
\n
stringstream S;
\n
\n
// Write field's string into S
\n@@ -1985,15 +1985,15 @@\n \n constexpr \n \n \n
\n \n

Pass this to a stream_from constructor to stream query results.

\n-
Deprecated:
Use transaction_base::stream instead of stream_from.
\n+
Deprecated:
Use transaction_base::stream instead of stream_from.
\n \n
\n
\n \n

◆ from_table

\n \n
\n@@ -2010,15 +2010,15 @@\n \n constexpr \n \n \n
\n \n

Pass this to a stream_from constructor to stream table contents.

\n-
Deprecated:
Use transaction_base::stream instead of stream_from.
\n+
Deprecated:
Use transaction_base::stream instead of stream_from.
\n \n
\n \n \n

◆ has_generic_bytes_char_traits

\n \n
\n"}, {"source1": "./usr/share/doc/libpqxx-doc/doxygen-html/namespacepqxx_1_1prepare.html", "source2": "./usr/share/doc/libpqxx-doc/doxygen-html/namespacepqxx_1_1prepare.html", "unified_diff": "@@ -90,15 +90,15 @@\n
\n \n
\n
pqxx::prepare Namespace Reference
\n
\n
\n

Detailed Description

\n-
Deprecated:
The new params class replaces all of this.
\n+
Deprecated:
The new params class replaces all of this.
\n
\n
\n \n
\n