-
-
Notifications
You must be signed in to change notification settings - Fork 442
Open
Labels
Description
For performance reasons, I'd like to do a number of large operations in memory, rather than interacting with the disk. This succeeds in creating an in-memory db: const db = new Database(':memory:');
However if I want to take an existing db and fully bring it into memory, this fails:
const db = new Database("./snapshot.db");
const buffer = db.serialize();
const inMemoryDb = new Database(buffer);
// Failure occurs on the next line:
inMemoryDb.prepare("SELECT phrase FROM Phrases");I get SqliteError: unable to open database file. I can confirm the buffer is filled with data that can be written to disk and loaded via the filesystem like usual. But creating a Database out of a buffer seems to always result in a failure.
Reactions are currently unavailable