SQLite Forum

DbStat via JDBC

DbStat via JDBC

(1) By DbSchema (dprutean) on 2020-12-28 09:32:22 [link] [source]

I tried to use or create the DBSTAT virtual table using JDBC.
Is this because the database was created without some parameters? Is it any way to create these statistics on an existing database? There are cases when people create a database, and later realize that they need statistics.

SELECT * FROM dbstat; -- no such a table

CREATE VIRTUAL TABLE temp.stat USING dbstat(main) -- no such a module: dbstat;

(2) By curmudgeon on 2020-12-28 10:47:43 in reply to 1 [source]

"The DBSTAT virtual table is available on all database connections when SQLite is built using the SQLITE_ENABLE_DBSTAT_VTAB compile-time option."

I've no knowledge of JDBC so not sure how you can implement that.

(3) By DbSchema (dprutean) on 2020-12-29 06:17:10 in reply to 2 [link] [source]

I use Sqlite as https://github.com/xerial/sqlite-jdbc Does I have to ask this project team to enable this option?

(4) By Gunter Hick (gunter_hick) on 2020-12-29 12:01:40 in reply to 3 [link] [source]

AFAICT sqlite-jdbc provides its own version of SQLite, but you may be able to substitute your own build of the SQLite library as per the instructions on the sqlite-jdbc page.