Fossil SCM

Add the ".vfslist" command to "fossil sqlite"

jan.nijtmans 2016-01-13 11:53 trunk
Commit 42c4d8f2d537a87659c32463c1c72231b149f370
1 file changed +19
+19
--- src/shell.c
+++ src/shell.c
@@ -1919,10 +1919,11 @@
19191919
" LIKE pattern TABLE.\n"
19201920
".timeout MS Try opening locked tables for MS milliseconds\n"
19211921
".timer on|off Turn SQL timer on or off\n"
19221922
".trace FILE|off Output each SQL statement as it is run\n"
19231923
".vfsinfo ?AUX? Information about the top-level VFS\n"
1924
+ ".vfslist List all available VFSes\n"
19241925
".vfsname ?AUX? Print the name of the VFS stack\n"
19251926
".width NUM1 NUM2 ... Set column widths for \"column\" mode\n"
19261927
" Negative values right-justify\n"
19271928
;
19281929
@@ -4165,10 +4166,28 @@
41654166
utf8_printf(p->out, "vfs.zName = \"%s\"\n", pVfs->zName);
41664167
raw_printf(p->out, "vfs.iVersion = %d\n", pVfs->iVersion);
41674168
raw_printf(p->out, "vfs.szOsFile = %d\n", pVfs->szOsFile);
41684169
raw_printf(p->out, "vfs.mxPathname = %d\n", pVfs->mxPathname);
41694170
}
4171
+ }
4172
+ }else
4173
+
4174
+ if( c=='v' && strncmp(azArg[0], "vfslist", n)==0 ){
4175
+ sqlite3_vfs *pVfs;
4176
+ sqlite3_vfs *pCurrent = 0;
4177
+ if( p->db ){
4178
+ sqlite3_file_control(p->db, "main", SQLITE_FCNTL_VFS_POINTER, &pCurrent);
4179
+ }
4180
+ for(pVfs=sqlite3_vfs_find(0); pVfs; pVfs=pVfs->pNext){
4181
+ utf8_printf(p->out, "vfs.zName = \"%s\"%s\n", pVfs->zName,
4182
+ pVfs==pCurrent ? " <--- CURRENT" : "");
4183
+ raw_printf(p->out, "vfs.iVersion = %d\n", pVfs->iVersion);
4184
+ raw_printf(p->out, "vfs.szOsFile = %d\n", pVfs->szOsFile);
4185
+ raw_printf(p->out, "vfs.mxPathname = %d\n", pVfs->mxPathname);
4186
+ if( pVfs->pNext ){
4187
+ raw_printf(p->out, "-----------------------------------\n");
4188
+ }
41704189
}
41714190
}else
41724191
41734192
if( c=='v' && strncmp(azArg[0], "vfsname", n)==0 ){
41744193
const char *zDbName = nArg==2 ? azArg[1] : "main";
41754194
--- src/shell.c
+++ src/shell.c
@@ -1919,10 +1919,11 @@
1919 " LIKE pattern TABLE.\n"
1920 ".timeout MS Try opening locked tables for MS milliseconds\n"
1921 ".timer on|off Turn SQL timer on or off\n"
1922 ".trace FILE|off Output each SQL statement as it is run\n"
1923 ".vfsinfo ?AUX? Information about the top-level VFS\n"
 
1924 ".vfsname ?AUX? Print the name of the VFS stack\n"
1925 ".width NUM1 NUM2 ... Set column widths for \"column\" mode\n"
1926 " Negative values right-justify\n"
1927 ;
1928
@@ -4165,10 +4166,28 @@
4165 utf8_printf(p->out, "vfs.zName = \"%s\"\n", pVfs->zName);
4166 raw_printf(p->out, "vfs.iVersion = %d\n", pVfs->iVersion);
4167 raw_printf(p->out, "vfs.szOsFile = %d\n", pVfs->szOsFile);
4168 raw_printf(p->out, "vfs.mxPathname = %d\n", pVfs->mxPathname);
4169 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4170 }
4171 }else
4172
4173 if( c=='v' && strncmp(azArg[0], "vfsname", n)==0 ){
4174 const char *zDbName = nArg==2 ? azArg[1] : "main";
4175
--- src/shell.c
+++ src/shell.c
@@ -1919,10 +1919,11 @@
1919 " LIKE pattern TABLE.\n"
1920 ".timeout MS Try opening locked tables for MS milliseconds\n"
1921 ".timer on|off Turn SQL timer on or off\n"
1922 ".trace FILE|off Output each SQL statement as it is run\n"
1923 ".vfsinfo ?AUX? Information about the top-level VFS\n"
1924 ".vfslist List all available VFSes\n"
1925 ".vfsname ?AUX? Print the name of the VFS stack\n"
1926 ".width NUM1 NUM2 ... Set column widths for \"column\" mode\n"
1927 " Negative values right-justify\n"
1928 ;
1929
@@ -4165,10 +4166,28 @@
4166 utf8_printf(p->out, "vfs.zName = \"%s\"\n", pVfs->zName);
4167 raw_printf(p->out, "vfs.iVersion = %d\n", pVfs->iVersion);
4168 raw_printf(p->out, "vfs.szOsFile = %d\n", pVfs->szOsFile);
4169 raw_printf(p->out, "vfs.mxPathname = %d\n", pVfs->mxPathname);
4170 }
4171 }
4172 }else
4173
4174 if( c=='v' && strncmp(azArg[0], "vfslist", n)==0 ){
4175 sqlite3_vfs *pVfs;
4176 sqlite3_vfs *pCurrent = 0;
4177 if( p->db ){
4178 sqlite3_file_control(p->db, "main", SQLITE_FCNTL_VFS_POINTER, &pCurrent);
4179 }
4180 for(pVfs=sqlite3_vfs_find(0); pVfs; pVfs=pVfs->pNext){
4181 utf8_printf(p->out, "vfs.zName = \"%s\"%s\n", pVfs->zName,
4182 pVfs==pCurrent ? " <--- CURRENT" : "");
4183 raw_printf(p->out, "vfs.iVersion = %d\n", pVfs->iVersion);
4184 raw_printf(p->out, "vfs.szOsFile = %d\n", pVfs->szOsFile);
4185 raw_printf(p->out, "vfs.mxPathname = %d\n", pVfs->mxPathname);
4186 if( pVfs->pNext ){
4187 raw_printf(p->out, "-----------------------------------\n");
4188 }
4189 }
4190 }else
4191
4192 if( c=='v' && strncmp(azArg[0], "vfsname", n)==0 ){
4193 const char *zDbName = nArg==2 ? azArg[1] : "main";
4194

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button