SQLite In-Memory Database

Posted by Joe Enos on April 29, 2021 · 1 min read

SQLite has an option for running completely in-memory, rather than using a local file on disk. This may be perfect for doing one-time data manipulation or other short-term tasks.

Just use :memory: instead of the database filename, and you'll get the in-memory database. Or use an empty string, to use memory only, but a temporary file on disk if memory starts to run low.

View code on GitHub