-
-
Notifications
You must be signed in to change notification settings - Fork 420
Cannot open Temporary Database #475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Related: a5fe469 What you are saying is that currently it behaves exactly like in-memory but you'd expect to see a temporary file to be create? Because the temporary database should be able to outgrow the memory, correct? |
Thank you for your reply! I guess the problem is not about seeing the temp file or how memory is used! The current behavior of better-sqlite3 is: But, as the sqlite3 document says, ':memory:' and '' are different! And, the behavior of sqlite3 creating database with '' is what I really wanted. Thank you very much! |
This is simply not true.
|
I was just skimming through this page back then and was interpreting "Even though a disk file is allocated for each temporary database" differently. It sounds like SQLite would immediately create a temporary file (seems reasonable to ensure fs permissions), but only write to it when needed. And I couldn't find said file (even after specifying the tmp folder using env vars I couldn't find the file). Thanks for clarifying. |
In case anyone comes across this. https://sqlite.org/forum/forumpost/62f9d03a80?t=h&unf
Emphasis mine. So that makes it hard to actually "see" the temporary file, because it's not necessarily actually in the file system. So even though the SQLite docs say "a disk file is allocated for each temporary database" it does not mean it's actually there because OS smart. |
Hello sir,
It seems that
require('better-sqlite3')('')
just open :memory: database instead of "Temporary Databases" !
From https://www.sqlite.org/inmemorydb.html :
" The sole difference is that a ":memory:" database must remain in memory at all times whereas parts of a temporary database might be flushed to disk if database becomes large or if SQLite comes under memory pressure. "
Thank you very much!
Best regards,
jo
The text was updated successfully, but these errors were encountered: