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

Update the built procedures for the sqlite3_analyzer utility to allow it

to be linked with an external sqlite3.o library.  Automatically detect a
missing dbstat extension and report the compile-time error.

FossilOrigin-Name: bb39744f4b2b25c10d293e85db7579e2a99c639fdab45e93d1de75952b68b2de
This commit is contained in:
drh
2017-10-31 14:56:44 +00:00
parent 6f09910779
commit d59fde3da5
4 changed files with 25 additions and 10 deletions

View File

@ -1,7 +1,9 @@
# Run this TCL script using "testfixture" in order get a report that shows
# how much disk space is used by a particular data to actually store data
# Run this TCL script using an SQLite-enabled TCL interpreter to get a report
# on how much disk space is used by a particular data to actually store data
# versus how much space is unused.
#
# The dbstat virtual table is required.
#
if {[catch {
@ -147,6 +149,17 @@ if {$flags(-debug)} {
db trace ::dbtrace
}
# Make sure all required compile-time options are available
#
if {![db exists {SELECT 1 FROM pragma_compile_options
WHERE compile_options='ENABLE_DBSTAT_VTAB'}]} {
puts "The SQLite database engine linked with this application\
lacks required capabilities. Recompile using the\
-DSQLITE_ENABLE_DBSTAT_VTAB compile-time option to fix\
this problem."
exit 1
}
db eval {SELECT count(*) FROM sqlite_master}
set pageSize [expr {wide([db one {PRAGMA page_size}])}]

View File

@ -14,7 +14,9 @@
#define SQLITE_DEFAULT_MEMSTATUS 0
#define SQLITE_MAX_EXPR_DEPTH 0
#define SQLITE_OMIT_LOAD_EXTENSION 1
#ifndef USE_EXTERNAL_SQLITE
INCLUDE sqlite3.c
#endif
INCLUDE $ROOT/src/tclsqlite.c
const char *sqlite3_analyzer_init_proc(Tcl_Interp *interp){