Ability to control the backing storage of Deno.openKv
In order to be able to write tests using Deno Kv there should be a way to control the storage.
Using strace I was able to locate the actual backing file: ~/.cache/deno/location_data/d6f888b9dae5a9d23bf85990c7609f8e3471db775bdd3bdf64c55c695353991d/kv.sqlite3. This file is shared for all invocations of deno from inside the project. I'd like to be able to specify :memory: (for regular test runs) or some other file (for debugging) as a backing store.
I am not sure what the right knobs would be. Probably cmdline argument would work the best for me. That would allow using empty ephemeral store as well as some curated prepopulated store for regression tests.
Sorry, I completely missed the argument to Deno.openKv (probably due to not being used in any of the examples). What happens when the argument is set to something while running on Deno Deploy? Is it ignored there?
You can specify the endpoint that implements KV Connect protocol.
denokv is a program to self-host sqlite-backed KV connect endpoint.