I haven't tested this, but you should be able to use the SQLite backup API to load your database into memory.
You'd likely open :memory:
(or ""
if you want a temporary, file backed DB), and then call sqlite_backup_from_file
to load the database in one shot.
e.g. (untested)
my $db = DBI->connect("dbi:SQLite:dbname=:memory:", '', '', {});
$db->sqlite_backup_from_file($ENV{DATABASE});
#Database should be loaded into the current memory DB at this point.