1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Changed ".databases" command to use PRAGMA database_list. (CVS 967)

FossilOrigin-Name: bad2065337d8dcaacd519b8f1730a90f1c933c3e
This commit is contained in:
jplyon
2003-05-11 20:07:05 +00:00
parent 5fe2d8c913
commit 672a1edfc8
3 changed files with 19 additions and 19 deletions

View File

@ -1,5 +1,5 @@
C Changes\sto\scomments.\s\sIn\sparticular,\sa\slengthy\scomment\swas\sadded\sto\sencode.c\r\nthat\sexplains\show\sthe\sencoder\salgorithm\sworks.\s(CVS\s966) C Changed\s".databases"\scommand\sto\suse\sPRAGMA\sdatabase_list.\s(CVS\s967)
D 2003-05-10T03:36:54 D 2003-05-11T20:07:05
F Makefile.in 004acec253ecdde985c8ecd5b7c9accdb210378f F Makefile.in 004acec253ecdde985c8ecd5b7c9accdb210378f
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@ -44,7 +44,7 @@ F src/pragma.c c2e932cb8962584d27300bb46723efd465bc8fe3
F src/printf.c fc5fdef6e92ad205005263661fe9716f55a49f3e F src/printf.c fc5fdef6e92ad205005263661fe9716f55a49f3e
F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe
F src/select.c c06b4605bca03d8237a3fc4098179bf3a7133702 F src/select.c c06b4605bca03d8237a3fc4098179bf3a7133702
F src/shell.c 89a14538b40fbfa15b0ad10b3367aab272bd9f15 F src/shell.c 88305ca3d0435cb5e5667c5b4cb991a2d63c1385
F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
F src/sqlite.h.in eec06462cba262c0ee03f38462a18a4bc66dda4e F src/sqlite.h.in eec06462cba262c0ee03f38462a18a4bc66dda4e
F src/sqliteInt.h 9b64d8225a26f3d5a376370b31060dd70bcc362b F src/sqliteInt.h 9b64d8225a26f3d5a376370b31060dd70bcc362b
@ -165,7 +165,7 @@ F www/speed.tcl cb4c10a722614aea76d2c51f32ee43400d5951be
F www/sqlite.tcl 4bd1729e320f5fa9125f0022b281fbe839192125 F www/sqlite.tcl 4bd1729e320f5fa9125f0022b281fbe839192125
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331 F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218 F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
P 26bd7bb1779e14f19c00e450aaa9529f2aabf131 P 8b388b2f690dbfd50eefc0fdede1c7785f78afa1
R b680c0a504530ce6590f8a3af4ddd816 R a62aff9c2d1ccd3470c73630c954d229
U drh U jplyon
Z d87b54e38f0dd3d4af38249efc6d41d2 Z 280acb47c3622340801e99c170c357f1

View File

@ -1 +1 @@
8b388b2f690dbfd50eefc0fdede1c7785f78afa1 bad2065337d8dcaacd519b8f1730a90f1c933c3e

View File

@ -12,7 +12,7 @@
** This file contains code to implement the "sqlite" command line ** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases. ** utility for accessing SQLite databases.
** **
** $Id: shell.c,v 1.77 2003/05/04 18:30:59 drh Exp $ ** $Id: shell.c,v 1.78 2003/05/11 20:07:05 jplyon Exp $
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -198,7 +198,7 @@ struct callback_data {
#define MODE_Semi 3 /* Same as MODE_List but append ";" to each line */ #define MODE_Semi 3 /* Same as MODE_List but append ";" to each line */
#define MODE_Html 4 /* Generate an XHTML table */ #define MODE_Html 4 /* Generate an XHTML table */
#define MODE_Insert 5 /* Generate SQL "insert" statements */ #define MODE_Insert 5 /* Generate SQL "insert" statements */
#define MODE_NUM_OF 6 #define MODE_NUM_OF 6 /* The number of modes (not a mode itself) */
char *modeDescr[MODE_NUM_OF] = { char *modeDescr[MODE_NUM_OF] = {
"line", "line",
@ -563,16 +563,16 @@ static int do_meta_command(char *zLine, struct callback_data *p){
n = strlen(azArg[0]); n = strlen(azArg[0]);
c = azArg[0][0]; c = azArg[0][0];
if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){ if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){
int i; struct callback_data data;
char *zErrMsg = 0;
open_db(p); open_db(p);
fprintf(p->out, "[Name]\t[File]\n"); memcpy(&data, p, sizeof(data));
for(i=0; i<db->nDb; i++){ data.showHeader = 0;
sqlite *db = p->db; data.mode = MODE_Column;
Db *pDb = &db->aDb[i]; sqlite_exec(p->db, "PRAGMA database_list; ", callback, &data, &zErrMsg);
BtOps* pOps = btOps(pDb->pBt); if( zErrMsg ){
const char *zName = pDb->zName; fprintf(stderr,"Error: %s\n", zErrMsg);
const char *zFilename = pOps->GetFilename(pDb->pBt); free(zErrMsg);
fprintf(p->out, "%s\t%s\n", zName, zFilename);
} }
}else }else