It looks like all the methods for loading SQLite involve loading from a named file using a string. I would like to load SQlite database from memory.
The database is already loaded into memory.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use a special file name,
:memory:libsqlitemust have been compiled withoutSQLITE_OMIT_MEMORYDBdefined, as pointed out in SQLite documentation:If you want to read the database that is already fully loaded into memory however, it will be more work. You will have to implement a custom VFS layer to operate on memory files and register it with your SQLite context.
See:
sqlite3_vfssqlite3_io_methodsI have not implemented it myself, so I can’t reliably tell whether you have to implement the entire new VFS layer, or you can get away with substituting some functions in the default one (latter is unlikely).