in reply to SQLite: how to get a number of rows from SELECT query
If the SQLite is new enough, you could use a window function:
select * , count(*) over () as rowcount from t ;
(But of course, now you have an extra column which is not always what you want. YMMV, etc)
In Section
Seekers of Perl Wisdom