Felix Hanley

Working with sqlite

sqlite

Runtime configuration

User version

See https://sqlite.org/pragma.html#pragma_user_version

The user-version is an integer that is available to applications to use however they want.

Set the user version:

pragma user_version = 22;

Read the current user version:

pragma user_version;

Determine sizes of tables

This only works if compiled with SQLITE_ENABLE_DBSTAT_VTAB. See https://www.sqlite.org/dbstat.html

select name, sum('pgsize') FROM dbstat group by name;