SQLite Forum

Temporary files - Clarifications about the docs
Login

Temporary files - Clarifications about the docs

(1) By anonymous on 2020-04-01 02:00:47 [source]

Hi,
since the temp_store_directory PRAGMA is deprecated and the usage of the sqlite3_temp_directory global variable is strongly discouraged, I suppose that specifying the location for temporary files wouldn't be possible at all if you were to start again from scratch and that there aren't (and won't be) other ways to specify this location.
Also, since you don't mention otherwise, I'm prone to think that the above global variable won't be removed in future versions (at least not in v3).
Is it still possible however that it will be left out if compiling with the SQLITE_OMIT_DEPRECATED. 
Is all of the above correct?

Finally, on https://sqlite.org/tempfiles.html it says:
"Whether or not temporary files other than the rollback, master, and statement journals are written to disk or stored only in memory depends on the SQLITE_TEMP_STORE compile-time parameter, the temp_store PRAGMA, and on the size of the temporary file."
So, if I set the SQLITE_TEMP_STORE compilation option to 2 (and don't use the temp_store PRAGMA) or 3, and run out of main memory, does SQLite autonomously write temporary data to the disk or is it left to the operating system to swap memory to disk (or not)?