1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-05 04:30:38 +03:00

Change the output format of the ".databases" command in the command-line shell

so that it shows the schema name, a colon, and the corresponding filename.

FossilOrigin-Name: 8558512e9ca343300a767ef23810f2d7b50fd925
This commit is contained in:
drh
2016-12-24 18:18:58 +00:00
parent a4b81d2a44
commit b20a61b704
3 changed files with 12 additions and 13 deletions

View 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);