/ Check-in [7ed86dd3]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Add code to the shell to optionally initialize the dbstat virtual table.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | stat-vtab-in-shell
Files: files | file ages | folders
SHA1: 7ed86dd3b85ee092a19fe5d1e2fba39ce0166a2a
User & Date: drh 2015-04-28 12:27:22
Context
2015-04-30
20:35
Enhance the CLI to initialize the dbstat virtual table if compiled using SQLITE_ENABLE_STAT_VTAB. check-in: 822dfc00 user: drh tags: trunk
2015-04-28
12:27
Add code to the shell to optionally initialize the dbstat virtual table. Closed-Leaf check-in: 7ed86dd3 user: drh tags: stat-vtab-in-shell
01:28
Fix comment typos. No code changes. check-in: 60174cf5 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

  1905   1905   ** Make sure the database is open.  If it is not, then open it.  If
  1906   1906   ** the database fails to open, print an error message and exit.
  1907   1907   */
  1908   1908   static void open_db(ShellState *p, int keepAlive){
  1909   1909     if( p->db==0 ){
  1910   1910       sqlite3_initialize();
  1911   1911       sqlite3_open(p->zDbFilename, &p->db);
         1912  +#ifdef SQLITE_ENABLE_STAT_VTAB_EXPERIMENTAL
         1913  +    if( p->db ){
         1914  +      int sqlite3_dbstat_register(sqlite3*);
         1915  +      sqlite3_dbstat_register(p->db);
         1916  +    }
         1917  +#endif
  1912   1918       globalDb = p->db;
  1913   1919       if( p->db && sqlite3_errcode(p->db)==SQLITE_OK ){
  1914   1920         sqlite3_create_function(p->db, "shellstatic", 0, SQLITE_UTF8, 0,
  1915   1921             shellstaticFunc, 0, 0);
  1916   1922       }
  1917   1923       if( p->db==0 || SQLITE_OK!=sqlite3_errcode(p->db) ){
  1918   1924         fprintf(stderr,"Error: unable to open database \"%s\": %s\n",