-C Always\sinclude\sa\sUTF-8\sBOM\sat\sthe\sbeginning\sof\sthe\soutput\sCSV\swhen\susing\nthe\s".excel"\scommand\son\sWindows,\sas\sthe\sactual\sExcel\sprogram\srequires\sthe\nBOM\sin\sorder\sto\swork\scorrectly.
-D 2024-09-25T12:56:44.564
+C Add\sthe\s"www"\soutput\smode\sthat\sinclude\s<table>\sin\sthe\sHTML\soutput.\nAdd\sthe\s".www"\scommand\sand\sthe\s"-w"\soption\sto\s".once".
+D 2024-09-25T13:29:03.338
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F src/resolve.c 9750a281f7ba073b4e6da2be1a6c4071f5d841a7746c5fb3f70d6d793b6675ea
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe
-F src/shell.c.in be499bb6bcd951a7fa9480588a824a03cef863c334f1843a2f4b76bcf31bd616
+F src/shell.c.in 9781ab726a108a10f8722d0d5e10c548d6f797ceef8d1a257a4e2cdc107bffc0
F src/sqlite.h.in 77f55bd1978a04a14db211732f0a609077cf60ba4ccf9baf39988f508945419c
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 1ee3fa0f0e87a61b5700abd56547c4acefe999317b0d53d66d890d9e09d8b7d9
-R aa31813957ce0d0538591043958b4e17
+P 04727fc00207325a76a5d5f20549c00232810ac727dedb70bc9e8112e60b3f56
+R a9ce986cea2b862753a371f08d91ab92
U drh
-Z 487c96328e404c2d5a7c68c4fa573337
+Z cd53dd6e20071a9c7b2de3e7e318715b
# Remove this line to create a well-formed Fossil manifest.
#define MODE_Count 17 /* Output only a count of the rows of output */
#define MODE_Off 18 /* No query output shown */
#define MODE_ScanExp 19 /* Like MODE_Explain, but for ".scanstats vm" */
+#define MODE_Www 20 /* Full web-page output */
static const char *modeDescr[] = {
"line",
"table",
"box",
"count",
- "off"
+ "off",
+ "scanexp",
+ "www",
};
/*
}
break;
}
+ case MODE_Www:
case MODE_Html: {
- if( p->cnt++==0 && p->showHeader ){
+ if( p->cnt==0 && p->cMode==MODE_Www ){
+ sqlite3_fputs(
+ "<TABLE border='1' cellspacing='0' cellpadding='2'>\n",p->out);
+ }
+ if( p->cnt==0 && p->showHeader ){
sqlite3_fputs("<TR>", p->out);
for(i=0; i<nArg; i++){
sqlite3_fputs("<TH>", p->out);
}
sqlite3_fputs("</TR>\n", p->out);
}
+ p->cnt++;
if( azArg==0 ) break;
sqlite3_fputs("<TR>", p->out);
for(i=0; i<nArg; i++){
sqlite3_free(pData);
if( pArg->cMode==MODE_Json ){
sqlite3_fputs("]\n", pArg->out);
+ }else if( pArg->cMode==MODE_Www ){
+ sqlite3_fputs("</TABLE>\n", pArg->out);
}else if( pArg->cMode==MODE_Count ){
char zBuf[200];
sqlite3_snprintf(sizeof(zBuf), zBuf, "%llu row%s\n",
" If FILE begins with '|' then open as a pipe",
" --bom Put a UTF8 byte-order mark at the beginning",
" -e Send output to the system text editor",
+ " -w Send output as HTML to a web browser (same as \".www\")",
" -x Send output as CSV to a spreadsheet (same as \".excel\")",
/* Note that .open is (partially) available in WASM builds but is
** currently only intended to be used by the fiddle tool, not
".vfsname ?AUX? Print the name of the VFS stack",
".width NUM1 NUM2 ... Set minimum column widths for columnar output",
" Negative values right-justify",
+#ifndef SQLITE_SHELL_FIDDLE
+ ".www Display output of the next command in web browser",
+#endif
};
/*
sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
}else if( cli_strncmp(zMode,"html",n2)==0 ){
p->mode = MODE_Html;
+ }else if( cli_strncmp(zMode,"www",n2)==0 ){
+ p->mode = MODE_Www;
}else if( cli_strncmp(zMode,"tcl",n2)==0 ){
p->mode = MODE_Tcl;
sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Space);
&& (cli_strncmp(azArg[0], "output", n)==0
|| cli_strncmp(azArg[0], "once", n)==0))
|| (c=='e' && n==5 && cli_strcmp(azArg[0],"excel")==0)
+ || (c=='w' && n==3 && cli_strcmp(azArg[0],"www")==0)
){
char *zFile = 0;
int bTxtMode = 0;
int i;
int eMode = 0;
- int bOnce = 0; /* 0: .output, 1: .once, 2: .excel */
+ int bOnce = 0; /* 0: .output, 1: .once, 2: .excel/.www */
static const char *zBomUtf8 = "\xef\xbb\xbf";
const char *zBom = 0;
if( c=='e' ){
eMode = 'x';
bOnce = 2;
+ }else if( c=='w' ){
+ eMode = 'w';
+ bOnce = 2;
}else if( cli_strncmp(azArg[0],"once",n)==0 ){
bOnce = 1;
}
if( z[1]=='-' ) z++;
if( cli_strcmp(z,"-bom")==0 ){
zBom = zBomUtf8;
- }else if( c!='e' && cli_strcmp(z,"-x")==0 ){
+ }else if( c=='o' && cli_strcmp(z,"-x")==0 ){
eMode = 'x'; /* spreadsheet */
- }else if( c!='e' && cli_strcmp(z,"-e")==0 ){
+ }else if( c=='o' && cli_strcmp(z,"-e")==0 ){
eMode = 'e'; /* text editor */
+ }else if( c=='o' && cli_strcmp(z,"-w")==0 ){
+ eMode = 'w'; /* Web browser */
}else{
sqlite3_fprintf(p->out,
"ERROR: unknown option: \"%s\". Usage:\n", azArg[i]);
rc = 1;
goto meta_command_exit;
}
- }else if( zFile==0 && eMode!='e' && eMode!='x' ){
+ }else if( zFile==0 && eMode==0 ){
zFile = sqlite3_mprintf("%s", z);
if( zFile && zFile[0]=='|' ){
while( i+1<nArg ) zFile = sqlite3_mprintf("%z %s", zFile, azArg[++i]);
}
output_reset(p);
#ifndef SQLITE_NOHAVE_SYSTEM
- if( eMode=='e' || eMode=='x' ){
+ if( eMode=='e' || eMode=='x' || eMode=='w' ){
p->doXdgOpen = 1;
outputModePush(p);
if( eMode=='x' ){
zBom = zBomUtf8; /* Always include the BOM on Windows, as Excel does
** not work without it. */
#endif
+ }else if( eMode=='w' ){
+ /* web-browser mode. */
+ newTempFile(p, "html");
+ p->mode = MODE_Www;
+ bTxtMode = 1;
}else{
/* text editor mode */
newTempFile(p, "txt");
i++;
}else if( cli_strcmp(z,"-html")==0 ){
data.mode = MODE_Html;
+ }else if( cli_strcmp(z,"-www")==0 ){
+ data.mode = MODE_Www;
}else if( cli_strcmp(z,"-list")==0 ){
data.mode = MODE_List;
}else if( cli_strcmp(z,"-quote")==0 ){