The in-memory database supports all operations and database access syntax, but is not actually saved; these are just data structures in memory. This makes it fast and great for developer experiments and (relatively small amounts) of temporary data, but it doesnβt go anywhere where you want the data to be saved (they save data that really cost, but reason number 1 for using the database) or where the total data set is larger than you can conveniently fit into your existing physical memory.
SQLite databases are created in conjunction with a specific file or pseudo file :memory: which is used when you want to retrieve a database in memory. You cannot change the location of the database during its opening, and the database in memory will be deleted when you close its connection; the only way to save this is to use queries to pull data from it and write it to another location (for example, a database on disk or some kind of dump file).
source share