]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Change the output format of the ".databases" command in the command-line shell
authordrh <drh@noemail.net>
Sat, 24 Dec 2016 18:18:58 +0000 (18:18 +0000)
committerdrh <drh@noemail.net>
Sat, 24 Dec 2016 18:18:58 +0000 (18:18 +0000)
so that it shows the schema name, a colon, and the corresponding filename.

FossilOrigin-Name: 8558512e9ca343300a767ef23810f2d7b50fd925

manifest
manifest.uuid
src/shell.c

index 812a43e8c05beff63ae6c3a42e381eb281b28db3..34ebd6213d89166031d92e5fad7a3d90f82f7645 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C In\sthe\scommand-line\sshell,\simprove\sthe\sformatting\sto\sthe\s".databases"\ncommand\sand\son\sthe\s".tables"\scommand,\sonly\sshow\sthe\sschema\sprefix\sfor\ndatabases\spast\sthe\sfirst\s("main")\sdatabase.
-D 2016-12-24T18:04:28.394
+C Change\sthe\soutput\sformat\sof\sthe\s".databases"\scommand\sin\sthe\scommand-line\sshell\nso\sthat\sit\sshows\sthe\sschema\sname,\sa\scolon,\sand\sthe\scorresponding\sfilename.
+D 2016-12-24T18:18:58.867
 F Makefile.in 41bd4cad981487345c4a84081074bcdb876e4b2e
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da
@@ -389,7 +389,7 @@ F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
 F src/resolve.c bb070cf5f23611c44ab7e4788803684e385fc3fb
 F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
 F src/select.c dfb6cadc3dcfba1b1bdbfba62ebba2b4b673413e
-F src/shell.c e99c2d27b263166a1eb58d7db200f481308a2066
+F src/shell.c 1594340a8c7b75751b73950f0006643d116d3ef5
 F src/sqlite.h.in e8e2d108d82647f0a812fdb74accf91c1ec08ddc
 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
 F src/sqlite3ext.h 8648034aa702469afb553231677306cc6492a1ae
@@ -1539,7 +1539,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 2940661b8c014b94973e05c44f1b1f4f443dbdd3
-R 52df4fe6a27080b6c7afd95948d62b3b
+P c0d5626e274cbf8c2d2167183c4d6835d72dae57
+R 70d48e0060cab5ee6418aa941c5a0469
 U drh
-Z 7fc049944b0ca3b30ace09cf9ed6380f
+Z 4cb56a28188b85f79aed3457527e657d
index ddb2c1308d6d6b909b94a0b9503c1a1e0795e0d0..bf31e58ff93baf554ec1fdf3491c04691016374e 100644 (file)
@@ -1 +1 @@
-c0d5626e274cbf8c2d2167183c4d6835d72dae57
\ No newline at end of file
+8558512e9ca343300a767ef23810f2d7b50fd925
\ No newline at end of file
index 3549ae36517461c56236e1823d875c8744e3fa44..2ad6c8c195e59819ef2191924b3f23c01e8b3e8c 100644 (file)
@@ -3704,13 +3704,12 @@ static int do_meta_command(char *zLine, ShellState *p){
     char *zErrMsg = 0;
     open_db(p, 0);
     memcpy(&data, p, sizeof(data));
-    data.showHeader = 1;
-    data.cMode = data.mode = MODE_Column;
-    data.colWidth[0] = 3;
-    data.colWidth[1] = 0;
-    data.colWidth[2] = 0;
+    data.showHeader = 0;
+    data.cMode = data.mode = MODE_List;
+    sqlite3_snprintf(sizeof(data.colSeparator),data.colSeparator,": ");
     data.cnt = 0;
-    sqlite3_exec(p->db, "PRAGMA database_list; ", callback, &data, &zErrMsg);
+    sqlite3_exec(p->db, "SELECT name, file FROM pragma_database_list",
+                 callback, &data, &zErrMsg);
     if( zErrMsg ){
       utf8_printf(stderr,"Error: %s\n", zErrMsg);
       sqlite3_free(zErrMsg);