Closed ncruces closed 4 months ago
ISTM that the best way to handle temporaries is to use a random key for every file that has empty path and OPEN_DELETEONCLOSE
and see if that covers everything. For these files we can even keep a length, avoiding the only issue Adiantum can't transparently handle (partial blocks at the end).
Users that don't want the overhead can still use PRAGMA temp_store
.
Any solution to (2) needs to be in addition to URI parameters, I guess. It's not just ATTACH … KEY
(that we can't do without patching SQLite). A PRAGMA
would probably solve that.
It's our backup API that assumes URIs. Forcing users to set keys through a _pragma=textkey(pass)
URI parameter, because URI parameters are bad, is a roundabout way to do it.
With URI parameters keys will be in guest memory for the duration of the connection. But we currently don't expose any API to retrieve them. So maybe that's OK?
Goals:
(1) Is important because most temporary files can hold database data, not just temporary tables, but transient views, sorter data, etc. I'd rather fail loudly than persist that data. We can also hold it in Go, rather than guest, memory.
(2) Would be nice because URI parameters are easily available to other parts of the application. A solution that works with
ATTACH
is elusive, though.