The sqlite3
command line tool allows me to .save <file>
the in-memory database without having to dump the SQL in its string/script form.
I'd like to do something similar without writing too much boilerplate code. However, I do not always want to save it, which is why I would like to avoid an on-disk DB before I actually need it.
Is there a way to do this in Python, short of dumping the SQL in string form and importing it to the on-disk file (which I know how to do and have already implemented)?