This may not actually be beneficial or feasible, so initially just an exercise in exploration.
Could we use sqlcipher to encrypt the in-memory SQLite database?
There may be some blockers for doing this though
- Cleartext will come in and out of memory whenever a query is run, so is it worth the overhead?
- The python bindings don't appear to be in the Debian repos, so it'd mean an extra setup step of manually installing them
Still, worth looking into rather than ruling out, out of hand.