How do I open an in-memory database file into sqlite3

两盒软妹~` 提交于 2019-11-27 23:46:11

问题


I'm on a system with no access to disk. My C program has in memory the contents of a valid, small, sqlite3 file (received over the network). I would like to use sqlite3's C API to open and access this file (read-only is fine).

How do I do this? I know I can create an empty in-memory database with

sqlite3_open(":memory:", &foo)

but is there any way to open my existing db? I don't have the privileges to create a ram disk, but perhaps something along those lines? Thanks.


回答1:


Code example here (in C):

http://www.mail-archive.com/sqlite-users@sqlite.org/msg15929.html



来源:https://stackoverflow.com/questions/837067/how-do-i-open-an-in-memory-database-file-into-sqlite3

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