Is there any Qt SQLite plugin for storing database in RAM by VFS (for loading database from Qt resource file)?
<p>I have some <code>:/test.sqlite3</code> database inside <code>.qrc</code>. And the goal is to directly use this database in program. Database used only for reading.</p>

<p><code>QSqlDatabase::setDatabase(":/test.sqlite3")</code> not works, because Qt SQLite not designed for working with Qt's filesystem.</p>

<p>One of solutions is copying database from <code>.qrc</code> into <code>D:\temdb.sqlite3</code> and using it by <code>QSqlDatabase::setDatabase("D:\\temdb.sqlite3")</code>. But program must not work with OS filesystem.</p>

<p>Second solution is storing <code>:/dump.sql</code> in resources, then creating in-memory database by <code>QSqlDatabase::setDatabase(":memory:")</code> and importing dump into it by reading and executing lines from <code>:/dump.sql</code>. But this method is slow.</p>

<p>And, finally, hard but true way is creating own Qt plugin for SQLite with <code>VFS</code> implementation for reading database from RAM, where we have bytes of  <code>":/test.sqlite3"</code>.</p>

<p>Is there any another easy way?</p>

<p>P.S. I have already read all questions like <a href="https://stackoverflow.com/questions/13622923/converting-in-memory-sqlite-database-to-blob-char-array">Converting in-memory sqlite database to blob/char array</a> and other, so don't mark it as duplicate. My question is about any other methods.</p>