/ Check-in [c0d5626e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c0d5626e274cbf8c2d2167183c4d6835d72dae57
User & Date: drh 2016-12-24 18:04:28
Context
2016-12-24
18:18
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. check-in: 8558512e user: drh tags: trunk
18:04
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. check-in: c0d5626e user: drh tags: trunk
2016-12-23
16:05
Fill in missing opcode documentation entries for OP_SorterNext and OP_SorterSort. check-in: 2940661b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

  3703   3703       ShellState data;
  3704   3704       char *zErrMsg = 0;
  3705   3705       open_db(p, 0);
  3706   3706       memcpy(&data, p, sizeof(data));
  3707   3707       data.showHeader = 1;
  3708   3708       data.cMode = data.mode = MODE_Column;
  3709   3709       data.colWidth[0] = 3;
  3710         -    data.colWidth[1] = 15;
  3711         -    data.colWidth[2] = 58;
         3710  +    data.colWidth[1] = 0;
         3711  +    data.colWidth[2] = 0;
  3712   3712       data.cnt = 0;
  3713   3713       sqlite3_exec(p->db, "PRAGMA database_list; ", callback, &data, &zErrMsg);
  3714   3714       if( zErrMsg ){
  3715   3715         utf8_printf(stderr,"Error: %s\n", zErrMsg);
  3716   3716         sqlite3_free(zErrMsg);
  3717   3717         rc = 1;
  3718   3718       }
................................................................................
  4974   4974       ** main and all attached databases where the table name matches the
  4975   4975       ** LIKE pattern bound to variable "?1". */
  4976   4976       zSql = sqlite3_mprintf(
  4977   4977           "SELECT name FROM sqlite_master"
  4978   4978           " WHERE type IN ('table','view')"
  4979   4979           "   AND name NOT LIKE 'sqlite_%%'"
  4980   4980           "   AND name LIKE ?1");
  4981         -    while( zSql && sqlite3_step(pStmt)==SQLITE_ROW ){
         4981  +    for(ii=0; zSql && sqlite3_step(pStmt)==SQLITE_ROW; ii++){
  4982   4982         const char *zDbName = (const char*)sqlite3_column_text(pStmt, 1);
  4983         -      if( zDbName==0 || strcmp(zDbName,"main")==0 ) continue;
         4983  +      if( zDbName==0 || ii==0 ) continue;
  4984   4984         if( strcmp(zDbName,"temp")==0 ){
  4985   4985           zSql = sqlite3_mprintf(
  4986   4986                    "%z UNION ALL "
  4987   4987                    "SELECT 'temp.' || name FROM sqlite_temp_master"
  4988   4988                    " WHERE type IN ('table','view')"
  4989   4989                    "   AND name NOT LIKE 'sqlite_%%'"
  4990   4990                    "   AND name LIKE ?1", zSql);