SQLite Forum

Where is the temporary database file stored?
Login
> ...  that the temporary file is only generated when it needs to be, rather than every time.

Not only that. In Operating Systems that allow it (Unix, Linux) SQLite will often unlink(3) temp files immediately after they are created.

The inode and space allocation will exist as long as SQLite has the file open, but the directory entry will vanish in less than the blink of an eye.