Skip to content
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

SQLITE_TMPDIR or pragma temp_store_directory #1314

Open
bergmorten opened this issue Jan 14, 2025 · 4 comments
Open

SQLITE_TMPDIR or pragma temp_store_directory #1314

bergmorten opened this issue Jan 14, 2025 · 4 comments

Comments

@bergmorten
Copy link

For my application, where I use SQLite in an Electron app for macOS with sandbox mode, I need to change the location where SQLite stores its temporary files. According to SQLite documentation, I can set the destination path using either a pragma or an environment variable. However, no matter what I try, better-sqlite3 stores the files in the same directory where I create the SQL file. Is there an option I might have missed to set the temporary file location?

@neoxpert
Copy link
Contributor

Well, the pragma is deprecated

About which temporary files are we talking here? Afaik SQLite does not support using a temp directory for all of them, but only the one which are used for temporary tables etc.

@bergmorten
Copy link
Author

bergmorten commented Jan 14, 2025 via email

@neoxpert
Copy link
Contributor

The WAL file will always be stored next to the database file, when not using memory persistence. There is no way to change this behaviour - except you want to deal with changing the C source code of SQLite.

@bergmorten
Copy link
Author

bergmorten commented Jan 15, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants