@kitsonk/kv-toolbox@0.29.0Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Utilities for working with Deno KV. Encrypted values, batching atomic transactions, handling blobs, querying/filtering, and more.
default
KV Toolbox
Open a ToolboxKv
or CryptoToolboxKv
instance for
interacting with the Deno KV store.
batched_atomic
Provides the function batchedAtomic
which is like
Deno.Kv.prototype.atomic
but will work around the per atomic
transaction limits imposed by Deno KV.
Options which can be adjusted when using a batched atomic.
Similar to Deno.Kv.prototype.atomic
but deals with the limits of
transactions imposed by Deno KV.
blob
A set of APIs for storing arbitrarily sized blobs in Deno KV. Currently Deno KV has a limit of key values being 64k.
When there are parts of a blob, this key will be set as a sub-key of the blob
blob entry, which will have additional sub-keys with the parts of the blob
stored as Uint8Array
with a key of an incrementing number.
An interface to represent a blob value as JSON.
Retrieve a binary object entry from the store with a given key that has been
set
.
Retrieve a binary object from the store as an object which which be safely converted into a JSON string.
Retrieve a blob value as a Response
which is suitable for sending
as a response to an HTTP request. This will read the blob out of the KV store
as a stream and set information in the response based on what is available
from the source.
Options which can be used when calling getAsResponse
.
Retrieve a binary object from the store as a byte ReadableStream
.
Retrieve a binary object's meta data from the store as a
Deno.KvEntryMaybe
.
Retrieve a list of keys in the database. The returned list is an
Deno.KvListIterator
which can be used to iterate over the blob
entries in the database, returning a ReadableStream
for each
matching blob entry. Any other values in the database will be ignored.
Remove/delete a binary object from the store with a given key that has been
set
.
Set the blob value in the provided Deno.Kv
with the provided
key. The blob can be any array buffer like structure, a byte
ReadableStream
, or a Blob
.
crypto
APIs for dealing with encrypted Deno KV values.
Generate a new random encryption key which can be used with
CryptoKv
. The value returned as a hex encoded string.
Valid data types that can be used when supplying an encryption key.
Open a Deno KV store and resolves with an instance of CryptoKv
which can be used to deal with encrypted values.
keys
APIs for dealing with Deno KV keys.
Determines if one Deno.KvKey
equals another. This is more
focused than a deeply equals comparison and compares key parts that are
Uint8Array
in a way that avoids potential code exploits.
Return an array of keys that match the query
.
Determines if one Deno.KvKeyPart
equals another. This is more
focused than just comparison as it compares Uint8Array
parts in a way that
avoids potential code exploits.
Determines if one Deno.KvKey
matches the prefix of another.
Query a Deno KV store for keys and resolve with any matching keys organized into a tree structure.
Resolves with an array of unique sub keys/prefixes for the provided query.
Resolves with an array of unique sub keys/prefixes for the provided prefix
along with the number of sub keys that match that prefix. The count
represents the number of sub keys, a value of 0
indicates that only the
exact key exists with no sub keys.
A representation of a filter as a JSON object.
A representation of a Deno.KvListSelector
as a JSON object.
The supported operations for filtering entries.
A representation of a property path to a value in an object. This is used to be able to query/filter entries based on nested properties.