With an SQLite database, I know I can do this to get the current size of the main database:
SELECT page_count * page_size as size FROM pragma_page_count(), pragma_page_size();
See also here (How to get the current sqlite database size or package size in Android?)
But how would I get the size of an attached database ?
In my case I have 'main' and an attached database 'db2' (ATTACH DATABASE 'something.db' as db2;
) and I tried this:
SELECT page_count * page_size as size FROM db2.pragma_page_count(), db2.pragma_page_size();
but it just returns 0, even though I know something is there.
It's easy to find documentation on PRAGMA page_count;
but I couldn't find much on pragma_page_count()