You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
constdb=newDatabase("./snapshot.db");constbuffer=db.serialize();constinMemoryDb=newDatabase(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.
The text was updated successfully, but these errors were encountered:
importDatabasefrom'better-sqlite3'constdb=newDatabase('./Chinook_Sqlite.sqlite');constbuffer=db.serialize();constinMemoryDb=newDatabase(buffer);conststmt=inMemoryDb.prepare('SELECT Name FROM Artist');console.log(stmt.all());
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:
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.The text was updated successfully, but these errors were encountered: