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

In the command-line shell, improve the formatting to the ".databases"

command and on the ".tables" command, only show the schema prefix for
databases past the first ("main") database.

FossilOrigin-Name: c0d5626e274cbf8c2d2167183c4d6835d72dae57
This commit is contained in:
drh
2016-12-24 18:04:28 +00:00
parent 6bd4dc6dc4
commit a4b81d2a44
3 changed files with 11 additions and 11 deletions

View File

@@ -3707,8 +3707,8 @@ static int do_meta_command(char *zLine, ShellState *p){
data.showHeader = 1;
data.cMode = data.mode = MODE_Column;
data.colWidth[0] = 3;
data.colWidth[1] = 15;
data.colWidth[2] = 58;
data.colWidth[1] = 0;
data.colWidth[2] = 0;
data.cnt = 0;
sqlite3_exec(p->db, "PRAGMA database_list; ", callback, &data, &zErrMsg);
if( zErrMsg ){
@@ -4978,9 +4978,9 @@ static int do_meta_command(char *zLine, ShellState *p){
" WHERE type IN ('table','view')"
" AND name NOT LIKE 'sqlite_%%'"
" AND name LIKE ?1");
while( zSql && sqlite3_step(pStmt)==SQLITE_ROW ){
for(ii=0; zSql && sqlite3_step(pStmt)==SQLITE_ROW; ii++){
const char *zDbName = (const char*)sqlite3_column_text(pStmt, 1);
if( zDbName==0 || strcmp(zDbName,"main")==0 ) continue;
if( zDbName==0 || ii==0 ) continue;
if( strcmp(zDbName,"temp")==0 ){
zSql = sqlite3_mprintf(
"%z UNION ALL "