@@ -29,6 +29,51 @@ namespace Data {
2929
3030class Data_API JSONRowFormatter: public Poco::Data::RowFormatter
3131 // / Class for JSON formatting of data rows.
32+ // /
33+ // / Formatter can be configured to operate in four modes (and
34+ // / certain combinations thereof) :
35+ // /
36+ // / - small (condensed mode, only array of values)
37+ // /
38+ // / Example:
39+ // / {
40+ // / [["Simpson", "Bart", "Springfield", 12],
41+ // / ["Simpson", "Lisa", "Springfield", 10]]
42+ // / }
43+ // /
44+ // / - row count (total row count provided)
45+ // /
46+ // / Example:
47+ // / {
48+ // / "count":2,
49+ // / [["Simpson", "Bart", "Springfield", 12],
50+ // / ["Simpson", "Lisa", "Springfield", 10]]
51+ // / }
52+ // /
53+ // / - column names (column names provided as a string array)
54+ // /
55+ // / Example:
56+ // / {
57+ // / "names":["LastName", "FirstName", "Address", "Age"],
58+ // / [["Simpson", "Bart", "Springfield", 12],
59+ // / ["Simpson", "Lisa", "Springfield", 10]]
60+ // / }
61+ // /
62+ // / - full (total row count, column names provided in every row of data)
63+ // /
64+ // / Example:
65+ // / {
66+ // / "count":2,
67+ // / [
68+ // / {"LastName": "Simpson", "FirstName": "Bart", "Address": "Springfield", "Age": 12},
69+ // / {"LastName": "Simpson", "FirstName": "Lisa", "Address": "Springfield", "Age": 10}
70+ // / ]
71+ // / }
72+ // /
73+ // / Total row count will be specified by the Poco::DataRecordSet. Note, however, that this is
74+ // / not possible to do accurately in case of result set paging. For those cases, there is
75+ // / setTotalRowCount() member function, which allows to explicitly set the total row count.
76+ // / If the total row count is preset on the formatter, the Data framework shall not interfere.
3277{
3378public:
3479 static const int JSON_FMT_MODE_SMALL = 1 ;
0 commit comments