]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Because version 3.52.0 was withdrawn, that means QRF has never been
authordrh <>
Sat, 21 Mar 2026 19:49:38 +0000 (19:49 +0000)
committerdrh <>
Sat, 21 Mar 2026 19:49:38 +0000 (19:49 +0000)
officially released.  Hence the new nMultiInsert field of the spec
can be moved out of the extensions area and into the main part of the
spec, and the version number can drop back from 2 to 1.

FossilOrigin-Name: cf19982241afb17e3db4148b8257f6737141935a291c340ab085c42ed946af1a

ext/qrf/README.md
ext/qrf/qrf.c
ext/qrf/qrf.h
manifest
manifest.uuid
src/shell.c.in
src/tclsqlite.c

index 4bb1790a4261c2a8c8819aa16f9caff87da517e0..8555cb0780d3748248e48dee4d08c8a33bd1380c 100644 (file)
@@ -115,6 +115,7 @@ struct sqlite3_qrf_spec {
   short int nScreenWidth;     /* Maximum overall table width */
   short int nLineLimit;       /* Maximum number of lines for any row */
   short int nTitleLimit;      /* Maximum number of characters in a title */
+  unsigned int nMultiInsert;  /* Add rows to one INSERT until size exceeds */
   int nCharLimit;             /* Maximum number of characters in a cell */
   int nWidth;                 /* Number of entries in aWidth[] */
   int nAlign;                 /* Number of entries in aAlignment[] */
@@ -381,7 +382,16 @@ can improve readability.   The nTitleLimit setting currently only
 works for **Box**, **Column**, **Line**, **Markdown**, and **Table**
 styles, though that limitation might change in future releases.
 
-### 2.9 Word Wrapping In Columnar Styles (nWrap, bWordWrap)
+### 2.9 Multiple Tuples Per INSERT In QRF_STYLE_Insert (nMultiInsert)
+
+If the sqlite3_qrf_spec.nMultiInsert value is positive, then the
+QRF_STYLE_Insert output mode will generate multiple tuples in
+each INSERT statement until the total number of bytes in the
+statement exceeds nMultiInsert.  A value of a few thousand is
+recommended here, in order to generate SQL output that is parsed
+and inserted at maximum speed by SQLite.
+
+### 2.10 Word Wrapping In Columnar Styles (nWrap, bWordWrap)
 
 When using columnar formatting modes (QRF_STYLE_Box, QRF_STYLE_Column,
 QRF_STYLE_Markdown, or QRF_STYLE_Table), the formatter attempts to limit
@@ -400,7 +410,7 @@ anywhere, including in the middle of a word.
 For narrow columns and wide words, it might sometimes be necessary to split
 a column in the middle of a word, even when bWordWrap is QRF_Yes.
 
-### 2.10 Helping The Output To Fit On The Terminal (nScreenWidth)
+### 2.11 Helping The Output To Fit On The Terminal (nScreenWidth)
 
 The sqlite3_qrf_spec.nScreenWidth field can be set the number of
 characters that will fit on one line on the viewer output device.
@@ -420,7 +430,7 @@ 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)
+### 2.12 Individual Column Width (nWidth and aWidth)
 
 The sqlite3_qrf_spec.aWidth field is a pointer to an array of
 signed 16-bit integers that control the width of individual columns
@@ -458,7 +468,7 @@ Again, negative values for aWidth\[\] entries are supported for
 backwards compatibility only, and are not recommended for new
 applications.
 
-### 2.12 Alignment (nAlignment, aAlignment, eDfltAlign, eTitleAlign)
+### 2.13 Alignment (nAlignment, aAlignment, eDfltAlign, eTitleAlign)
 
 Some cells in a display table might contain a lot of text and thus
 be wide, or they might contain newline characters or be wrapped by
@@ -537,7 +547,7 @@ specify a vertical alignment, then values are top-aligned
 The vertical alignment settings are currently ignored and 
 the vertical alignment is always QRF_ALIGN_Top.*
 
-### 2.13 Row and Column Separator Strings
+### 2.14 Row and Column Separator Strings
 
 The sqlite3_qrf_spec.zColumnSep and sqlite3_qrf_spec.zRowSep strings
 are alternative column and row separator character sequences.  If not
@@ -545,18 +555,18 @@ specified (if these pointers are left as NULL) then appropriate defaults
 are used.  Some output styles have hard-coded column and row separators
 and these settings are ignored for those styles.
 
-### 2.14 The Output Table Name
+### 2.15 The Output Table Name
 
 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)
+### 2.16 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.
 
-### 2.16 Optional Value Rendering Callback
+### 2.17 Optional Value Rendering Callback
 
 If the sqlite3_qrf_spec.xRender field is not NULL, then each
 sqlite3_value coming out of the query is first passed to the
@@ -709,7 +719,10 @@ the `<TABLE>..</TABLE>` around the outside.
 The **Insert** style generates a series of SQL "INSERT" statements
 that will inserts the data that is output into a table whose name is defined
 by the zTableName field of `sqlite3_qrf_spec`.  If zTableName is NULL,
-then a substitute name is used.
+then a substitute name is used.  If nMultiInsert is positive, then the
+output will add multiple rows to each INSERT statement until the size
+of the INSERT statement exceeds nMultiInsert bytes before starting
+a new INSERT statement.
 
 The **Json** and **JObject** styles generates JSON text for the query result.
 The **Json** style produces a JSON array of structures with one 
index c92627bf54c3235ff31e052c2b61cbc385d81c1e..75cff2749c80d168f3ca293b491456318d350b23 100644 (file)
@@ -2564,7 +2564,7 @@ static void qrfOneSimpleRow(Qrf *p){
       break;
     }
     case QRF_STYLE_Insert: {
-      unsigned int mxIns = p->spec.iVersion>=2 ? p->spec.nMultiInsert : 0;
+      unsigned int mxIns = p->spec.nMultiInsert;
       int szStart = sqlite3_str_length(p->pOut);
       if( p->u.nIns==0 || p->u.nIns>=mxIns ){
         if( p->u.nIns ){
@@ -2712,7 +2712,7 @@ static void qrfInitialize(
   size_t sz;                     /* Size of pSpec[], based on pSpec->iVersion */
   memset(p, 0, sizeof(*p));
   p->pzErr = pzErr;
-  if( pSpec->iVersion>2 ){
+  if( pSpec->iVersion>1 ){
     qrfError(p, SQLITE_ERROR,
        "unusable sqlite3_qrf_spec.iVersion (%d)",
        pSpec->iVersion);
index fbea33a21f8b8480a37c2f8dbca900b9e5663e50..2630bb823e3ac3fcd80fc740684b4dc337471a00 100644 (file)
@@ -42,6 +42,7 @@ struct sqlite3_qrf_spec {
   short int nScreenWidth;     /* Maximum overall table width */
   short int nLineLimit;       /* Maximum number of lines for any row */
   short int nTitleLimit;      /* Maximum number of characters in a title */
+  unsigned int nMultiInsert;  /* Add rows to one INSERT until size exceeds */
   int nCharLimit;             /* Maximum number of characters in a cell */
   int nWidth;                 /* Number of entries in aWidth[] */
   int nAlign;                 /* Number of entries in aAlignment[] */
@@ -56,8 +57,6 @@ struct sqlite3_qrf_spec {
   void *pRenderArg;           /* First argument to the xRender callback */
   void *pWriteArg;            /* First argument to the xWrite callback */
   char **pzOutput;            /* Storage location for output string */
-  /* Fields below are only available if iVersion>=2 */
-  unsigned int nMultiInsert;  /* Add rows to one INSERT until size exceeds */
   /* Additional fields may be added in the future */
 };
 
index acddb00b94353d19981b8aeeaf548fb2337dc09b..499ce65cdd333acab64e60c975de79edd6abd25b 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Try\sto\sfix\sharmless\scompiler\swarnings\sfrom\slegacy\sC\scompilers\sin\sthe\sCLI.
-D 2026-03-21T13:21:41.596
+C Because\sversion\s3.52.0\swas\swithdrawn,\sthat\smeans\sQRF\shas\snever\sbeen\nofficially\sreleased.\s\sHence\sthe\snew\snMultiInsert\sfield\sof\sthe\sspec\ncan\sbe\smoved\sout\sof\sthe\sextensions\sarea\sand\sinto\sthe\smain\spart\sof\sthe\nspec,\sand\sthe\sversion\snumber\scan\sdrop\sback\sfrom\s2\sto\s1.
+D 2026-03-21T19:49:38.046
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -419,10 +419,10 @@ F ext/misc/wholenumber.c 0fa0c082676b7868bf2fa918e911133f2b349bcdceabd1198bba5f6
 F ext/misc/windirent.h 02211ce51f3034c675f2dbf4d228194d51b3ee05734678bad5106fff6292e60c
 F ext/misc/zipfile.c c8ee04e1b349270b5df401ad732f5d7c387146e69b33c02fa90322760cc6fee0
 F ext/misc/zorder.c bddff2e1b9661a90c95c2a9a9c7ecd8908afab5763256294dd12d609d4664eee
-F ext/qrf/README.md e6e0ce2700acf6fd06312b42726a8f08ca240f30e1b122bff87c71c602046352
+F ext/qrf/README.md 9e644615d7d7b77ef7e9db798765679e50c5ed12eda48bce21c9ef9eb4715e9d
 F ext/qrf/dev-notes.md e68a6d91ce4c7eb296ef2daadc2bb79c95c317ad15b9fafe40850c67b29c2430
-F ext/qrf/qrf.c 668456bdcfa1ad7914f21ee3846404494efbdfc8b6b6557a2ec27a17e1f92b29
-F ext/qrf/qrf.h 2b27cb8079131ac3af2134e9e2ee9621b41d97bcb546fead41b9e1a12a3567a7
+F ext/qrf/qrf.c 7334c688296f818f99c0cf37318b279ef62982a4860762096158237981fecb06
+F ext/qrf/qrf.h 751fc5b102fa7e19aa4f1e2e75012fdc477bf6af7409dff36f9de5a9f3f6cf22
 F ext/rbu/rbu.c 801450b24eaf14440d8fd20385aacc751d5c9d6123398df41b1b5aa804bf4ce8
 F ext/rbu/rbu1.test 25870dd7db7eb5597e2b4d6e29e7a7e095abf332660f67d89959552ce8f8f255
 F ext/rbu/rbu10.test 7c22caa32c2ff26983ca8320779a31495a6555737684af7aba3daaf762ef3363
@@ -734,7 +734,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
 F src/resolve.c 928ff887f2a7c64275182060d94d06fdddbe32226c569781cf7e7edc6f58d7fd
 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
 F src/select.c ffe199f025a0dd74670d2a77232bdea364a4d7b36f32c64a6572d39ba6a11576
-F src/shell.c.in 12591bec4a31009568598f6ced61af351ebabebb5bdee518652696c8ede9c1b2
+F src/shell.c.in 4a9217005b76017bc90a08f87c45ea273d796273e0b0a3e4c621a5051a4ae95d
 F src/sqlite.h.in 4d657846d68a58b028f0c4c331b9d3b4a79306f25c3b0d04fb56060343f73d85
 F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
 F src/sqlite3ext.h 1b7a0ee438bb5c2896d0609c537e917d8057b3340f6ad004d2de44f03e3d3cca
@@ -742,7 +742,7 @@ F src/sqliteInt.h 9716721fb57e32938a1d30a84560ce7633c63860a2209e188c87afad15d4b4
 F src/sqliteLimit.h 904a3f520362c7065c18165aaabd504fb13cc1b76cb411f38bd41ac219e4af1e
 F src/status.c 7565d63a79aa2f326339a24a0461a60096d0bd2bce711fefb50b5c89335f3592
 F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
-F src/tclsqlite.c 71230da35d81b7234c5e4dc3747ca2302390884b051052956deb3dbf680a6ed4
+F src/tclsqlite.c 7401c73c917a4d1b380c896a324c8d8eb533a999559d9e339d479596553bebfd
 F src/tclsqlite.h 614b3780a62522bc9f8f2b9fb22689e8009958e7aa77e572d0f3149050af348a
 F src/test1.c 3e3b013f59ffcb57dce00c90d55907072d71d4e970cb0a590cb261efe11bae9c
 F src/test2.c 2b9ab96bba63a1c369d5769390475259ad210f144a877805f2e32e563f9e93c1
@@ -2195,8 +2195,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee
 F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
 F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
-P d56954146ce5eccd63b65242abe2e6556dbceda39a58eab39f5884884afea337
-R 0129e38ad9c79d253f804aaef0141abd
+P 8e1d0c4eac303cd0834449f4792605c0ed983db1f360af42300f0048dadbbef8
+R a41bf058e42684a09ca798bb17f3d8b8
 U drh
-Z ab8665968bffa0781aaf0a4f9e5a0e91
+Z 3d0e6419f275717c17fd604ea7b5f9df
 # Remove this line to create a well-formed Fossil manifest.
index 569496be07aca36a78893175c1d8bcb66f8ac375..f9384f17f27676b9dde5eae55a06678886b8f3d3 100644 (file)
@@ -1 +1 @@
-8e1d0c4eac303cd0834449f4792605c0ed983db1f360af42300f0048dadbbef8
+cf19982241afb17e3db4148b8257f6737141935a291c340ab085c42ed946af1a
index 24ec4c771b824b636f497237af43ef8575a81c3f..2ee7f21e4d63a4d23fadf68d8511fc0de3f449ea 100644 (file)
@@ -1575,7 +1575,7 @@ static void modeFree(Mode *p){
   free(p->spec.zTableName);
   free(p->spec.zNull);
   memset(p, 0, sizeof(*p));
-  p->spec.iVersion = 2;
+  p->spec.iVersion = 1;
   p->autoExplain = autoExplain;
 }
 
@@ -1691,7 +1691,7 @@ static void modeChange(ShellState *p, unsigned char eMode){
 ** already been freed and zeroed prior to calling this routine.
 */
 static void modeDefault(ShellState *p){
-  p->mode.spec.iVersion = 2;
+  p->mode.spec.iVersion = 1;
   p->mode.autoExplain = 1;
   if( stdin_is_interactive || stdout_is_console ){
     modeChange(p, MODE_TTY);
index 3e2db54a4e02ece27568dfa314743c2c497006f8..8f46f7e810cc1bc4af7f2d37c177f58f886a9a19 100644 (file)
@@ -2136,7 +2136,7 @@ static int dbQrf(SqliteDb *pDb, int objc, Tcl_Obj *const*objv){
   };
 
   memset(&qrf, 0, sizeof(qrf));
-  qrf.iVersion = 2;
+  qrf.iVersion = 1;
   qrf.pzOutput = &zResult;
   for(i=2; i<objc; i++){
     const char *zArg = Tcl_GetString(objv[i]);