title: Using SQLite with std::iostream
body: <p>Does someone know a wrapper which would allow SQLite to load its data from an <code>std::iostream</code>?</p>
  
  <p>To be more explicit:</p>
  
  <pre><code>std::fstream dataStream("database.sqlite");
  ...
  sqlite3_open(...something using dataStream...);
  </code></pre>
  
  <p>I want to use streams because of their modularity: being able to load a file while it is still being downloaded from the network, decompressing data on-the-fly, etc.</p>
  
  <p>It should be possible by using <a href="http://www.sqlite.org/c3ref/open.html" rel="noreferrer">sqlite3_open_v2</a> after registering your own <a href="http://www.sqlite.org/c3ref/vfs.html" rel="noreferrer">VFS</a>. After one hour of implementing (badly-documented) functions, my first attempts got me a weird "out of memory" error from SQLite, and I thought I would ask here if someone knows an existing implementation before spending hours debugging mine.</p>