Access SQLite db from MMF

空扰寡人 提交于 2019-12-07 04:47:03

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/13543146/access-sqlite-db-from-mmf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!