~~~
The `sqlite3_qrf_spec` object describes the desired output format
-and what to do with the generated output. Most of the work in using
+and where to send the generated output. Most of the work in using
the QRF involves filling out the sqlite3_qrf_spec.
## 2.0 The `sqlite3_qrf_spec` object
-The `sqlite3_qrf_spec` structure defines how the results of a query
-are to be formatted, and what to do with the formatted text. The
-most recent definition of `sqlite3_qrf_spec` is shown below.
+The most recent definition of `sqlite3_qrf_spec` is shown below.
-Do not be alarmed by the complexity of this structure. You only have
+Do not be alarmed by the complexity of this structure. You only need
to understand the properties you want to modify. Zero is always a good
default for all of the attributes (except iVersion and pzOutput/xWrite)
and so simply zeroing out the bulk of this structure is a good start.
unsigned char bTitles; /* True to show column names */
unsigned char bWordWrap; /* Try to wrap on word boundaries */
unsigned char bTextJsonb; /* Render JSONB blobs as JSON text */
- unsigned char bTextNull; /* Apply eText encoding to zNull[] */
unsigned char eDfltAlign; /* Default alignment, no covered by aAlignment */
unsigned char eTitleAlign; /* Alignment for column headers */
+ unsigned char bSplitColumn; /* Wrap single-column output into many columns */
short int nWrap; /* Wrap columns wider than this */
short int nScreenWidth; /* Maximum overall table width */
short int nLineLimit; /* Maximum number of lines for any row */
### 2.1 Structure Version Number
The sqlite3_qrf_spec.iVersion field must be 1. Future enhancements to
-the QRF might add new fields onto the bottom of the sqlite3_qrf_spec
+the QRF might add new fields to the bottom of the sqlite3_qrf_spec
object. Those new fields will only be accessible if the iVersion is greater
than 1. Thus the iVersion field is used to support upgradability.
sqlite3_qrf_spec.pzOutput points to a pointer to a character, then that
pointer is made to point to memory obtained from sqlite3_malloc() that
contains the complete text of the formatted output. If spec.pzOutput\[0\]
-is initially non-NULL, then it is assumed to point to memory obtained
+is initially non-NULL, then it is assumed to already point to memory obtained
from sqlite3_malloc(). In that case, the buffer is resized using
sqlite3_realloc() and the new text is appended.
### 2.3 Output Format
The sqlite3_qrf_spec.eStyle field is an integer code that defines the
-specific output format that will be generated. See section 4.0 below
-for details on the meaning of the various style options.
+specific output format that will be generated. See [section 4.0](#style)
+below for details on the meaning of the various style options.
Other fields in sqlite3_qrf_spec might be used or might be
ignored, depending on the value of eStyle.
#define QRF_BLOB_Hex 3 /* Hexadecimal representation */
#define QRF_BLOB_Tcl 4 /* "\000" notation */
#define QRF_BLOB_Json 5 /* A JSON string */
+#define QRF_BLOB_Size 6 /* Display the blob size only */
~~~
A value of QRF_BLOB_Auto means that display format is selected automatically
previous paragraph would be shown as
`"\u0005\u0028\u0081\u00f3"`.
+A value of QRF_BLOB_Size does not show any BLOB content at all.
+Instead, it substitutes a text string that says how many bytes
+the BLOB contains.
+
### 2.8 Maximum size of displayed content (nLineLimit, nCharLimit)
If the sqlite3_qrf_spec.nCharLimit setting is non-zero, then the formatter
The formatter trieds to keep lines below the nScreenWidth limit,
but it does not guarantee that it will.
+The nScreenWidth field currently only makes a difference in
+columnar styles (**Box**, **Column**, **Markdown**, and **Table**)
+and in the **Line** style.
+
### 2.11 Individual Column Width (nWidth and aWidth)
The sqlite3_qrf_spec.aWidth field is a pointer to an array of
The sqlite3_qrf_spec.zTableName value is the name of the output table
when eStyle is QRF_STYLE_Insert.
-### 2.15 The Rendering Of NULL (zNull, eTextNull)
+### 2.15 The Rendering Of NULL (zNull)
If a value is NULL then show the NULL using the string
found in sqlite3_qrf_spec.zNull. If zNull is itself a NULL pointer
then NULL values are rendered as an empty string.
-If the sqlite3_qrf_spec.bTextNull field is QRF_Yes, then the
-text encoding specified by eText is applied to the value in
-zNull. If bTextNull is QRF_No or QRF_Auto, then the value
-in zNull is shown verbatim.
-
### 2.16 Optional Value Rendering Callback
If the sqlite3_qrf_spec.xRender field is not NULL, then each
from sqlite3_malloc() and it is the responsibility of the caller to
free that memory by a subsequent call to sqlite3_free().
+<a id="style"></a>
## 4.0 Output Styles
The result formatter supports a variety of output styles. The
-output style used is determined by the eStyle setting of the
-sqlite3_qrf_spec object. The set of supported output modes
-might increase in future versions.
+output style (sometimes called "output mode") is determined by
+the eStyle field of the sqlite3_qrf_spec object. The set of
+supported output modes might increase in future versions.
The following output modes are currently defined:
> ~~~
psql. The **Markdown** renders its result in the
Markdown table format.
+#### 4.2.1 Split Column Mode
+
+If the bSplitColumn field is QRF_Yes, and eStyle is QRF_STYLE_Column,
+and bTitles is QRF_No, and nScreenWidth is greater than zero, and if
+the query only returns a single column, then a special rendering known
+as "Split Column Mode" will be used. In split column mode, instead
+of showing all results in one tall column, the content wraps vertically
+so that it appears on the screen as multiple columns, as many as will
+fit in the available screen width.
+
### 4.3 Line-oriented Styles
The line-oriented styles output each row of result as it is received from
* `qrf.c` → The implementation, written in portable C99
* `qrf.h` → A header file defining interfaces
- * `README.md` → This documentation, in Markdown
+ * `README.md` → This documentation
To use the SQLite result formatter, include the "`qrf.h`" header file
and link the application against the "`qrf.c`" source file.
-C Fix\stypos\sin\sthe\shelp\stext\sfor\s".mode"\sof\sthe\sCLI.
-D 2025-11-25T00:21:27.341
+C Omit\sthe\sunused\sbTextNull\sflag\sfrom\sthe\sQRF\sspec\sobject.
+D 2025-11-25T10:53:39.167
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F ext/misc/windirent.h 02211ce51f3034c675f2dbf4d228194d51b3ee05734678bad5106fff6292e60c
F ext/misc/zipfile.c 09e6e3a3ff40a99677de3c0bc6569bd5f4709b1844ac3d1c1452a456c5a62f1c
F ext/misc/zorder.c bddff2e1b9661a90c95c2a9a9c7ecd8908afab5763256294dd12d609d4664eee
-F ext/qrf/README.md dd565fd1ca0c46ea37dbf4d496e368b9ecade768c92669640bc106e039629016
-F ext/qrf/qrf.c af7c0f07ec880077f2cb8cbb32012523080be10c22a9a03fbd434b21bf46f650
-F ext/qrf/qrf.h a758fd35e488ef93c7fe145aa96c228c985d3c4691eb89da6328ef3ebe1fedce
+F ext/qrf/README.md c4ee554743fa61858e5685a90689c011adb549a4e5467d3c639c9bc57ba00bb0
+F ext/qrf/qrf.c 5bc46d1ea06d8355b2b25f39f19c90be370de1a3f34d0dab2624ee54702edbe1
+F ext/qrf/qrf.h fe677b8564dd8feaff6d2876a0e06c2e1d8ceaa6f00acd179da92a9e87c2955a
F ext/rbu/rbu.c 801450b24eaf14440d8fd20385aacc751d5c9d6123398df41b1b5aa804bf4ce8
F ext/rbu/rbu1.test 25870dd7db7eb5597e2b4d6e29e7a7e095abf332660f67d89959552ce8f8f255
F ext/rbu/rbu10.test 7c22caa32c2ff26983ca8320779a31495a6555737684af7aba3daaf762ef3363
F src/sqliteLimit.h 0a5516b4ec192a205c541e05f67009028a9451dc6678aae4cf8e68596903c246
F src/status.c 7565d63a79aa2f326339a24a0461a60096d0bd2bce711fefb50b5c89335f3592
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
-F src/tclsqlite.c 3a5f08de6c6d3b7b0d1b68f585113e2310e875e9517548797eac34375d7bcbfb
+F src/tclsqlite.c d0afbb037e9c6e505312eb811fd7ee7ce28328d57bb8c46312fd676ca4e30318
F src/tclsqlite.h 614b3780a62522bc9f8f2b9fb22689e8009958e7aa77e572d0f3149050af348a
F src/test1.c 0e71fbcb484a271564e98e0158192c28c24f5521594218c3ba48bcb4cf634f91
F src/test2.c 62f0830958f9075692c29c6de51b495ae8969e1bef85f239ffcd9ba5fb44a5ff
F test/progress.test ebab27f670bd0d4eb9d20d49cef96e68141d92fb
F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc
F test/pushdown.test 46a626ef1c0ca79b85296ff2e078b9da20a50e9b804b38f441590c3987580ddd
-F test/qrf01.test 6aae6741fc307bae4dd647eaccf2186eb32704a2e5db36eb8e9042e9a1b2a7b8
+F test/qrf01.test 1cd0ef5c758dca528f01e47504f3b3181463a29919de06a9dffa7fe174575ead
F test/qrf02.test 39b4afdc000bedccdafc0aecf17638df67a67aaa2d2942865ae6abcc48ba0e92
F test/qrf03.test 9de53aea459f5a127283db03cbb6011500757685646d21aa3c29c44c6ef23e86
F test/qrf04.test 0894692c998d2401dcc33449c02051b503ecce0c94217be54fb007c82d2d1379
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 76a986b10d284b25915a07b7150ef1b85f4ef7d48d4e5315b13e7d1532cb97f1
-R ce9b96379c1e19a74d47e4730d63c902
+P fddb99c5162ba12a6e3c87e96583d57bae217339b4dd6dc44c3538e738fbf625
+R 19c8024eece0b94602f3e973f1400c0b
U drh
-Z 36c33fbd074bfb111103b1a1aa50c14a
+Z e4e4a6ce87bae873cadc031e73619545
# Remove this line to create a well-formed Fossil manifest.