Search code examples
c#sqlitememory-mapped-filesmemory-mapping

Access SQLite db from MMF


I'm using System.Data.SQLite lib to access my SQLite database. I want to load the db file to memory and use MMF (Memory Mapped Files) to access the database.

Is this possible using the default SQLite library?

edit:

Alternatives on how I can have an in-memory database are welcome.


Solution

  • no...

    You can:

    • create an in-memory DB instance (specify in connection string Data Source=:memory:) and load the contents from the DB file into that instance... when you change contents of the in-memory instance your DB file won't get updated... you could later on save the in-memory instance content into a DB file... one way to do this

    • use a RAM disk and copy the db file into that RAM disk...

    • modify the source code of the library to support MMF