Read the value at this key.
Expected shape of the stored value.
The stored value, or null if the key doesn't exist.
Read your writes => a value still sitting in the collector buffer wins over the stored row,
so a queued set() is visible to the very next get() without waiting for the flush. The
buffered copy goes through the same JSON round trip the driver does, so a value doesn't
change shape depending on whether it landed yet.
Write a value at this key (upsert).
The write is scheduled the moment you call set() => a fire and forget set(v) with no
await and no .force() still lands. Awaiting it only decides whether you wait for the queue
(or the driver, when the collector is off); .force() swaps the queued copy for an immediate
durable write.
InvalidValueError (a TypeError) for a value the two engines can't store
identically => undefined, NaN/Infinity, a NUL character anywhere in a string or property
name, a circular reference, or a BigInt.
DatabaseUnavailableError at the call site when the collector's breaker is open.
Eager on purpose (A2): the old behaviour was lazy => a set() that was never awaited & never
forced quietly did nothing, which is the easiest way there is to lose a write. Now the queue
happens synchronously, at the call, so the only thing await changes is when you find out it's
done.
Validation is synchronous too => a bad value (or an open breaker) throws right here, before
anything is queued or written, so it can't sit in the buffer & blow up inside a flush where the
only trace is a log line. undefined as an object property is still dropped, the way
JSON.stringify always has.
A value round trips through JSON, so two things are stored but come back reshaped rather than
refused: an integer past Number.MAX_SAFE_INTEGER (2^53) loses precision the moment it's read
back as a JS number (12345678901234567890 returns as ...567000), and a Buffer/typed array
degrades to { type: 'Buffer', data: [...] }, never a Buffer again. store a big integer as a
string & base64 encode binary yourself if you need either back intact => this is JSON's doing,
not the engine's, so it's identical in local & cloud mode. only the id (key) is precision safe.
Delete this key.
Deletes always run immediately, even when awaited without .force(). Routing them
through the collector would mean a queued set() on the same key could land after
the delete & resurrect the row. .force() is accepted for API symmetry.
Any value still buffered for this key is dropped first, so a queued set() issued before
the delete can't come back on the next flush.
Does this key exist?
true if a value is stored (or buffered) for this key, false otherwise.
A queued set() counts as existing (read your writes), so the buffer is checked first. Past
that it asks the driver's existence check rather than get() !== null => a row storing a
literal null value still exists, and has() has to say so where get() can only return the
null it can't tell apart from a missing key.
Add to the number stored at this key (a missing key counts as 0).
How much to add (may be negative).
The new total.
InvalidValueError if the result isn't finite (e.g. adding Infinity).
Read-modify-write, not atomic => it reads (seeing its own buffered writes), computes, then
writes back through the collector. Two un-awaited add()s on the same key can read the same
base & one update is lost. Sequential awaited calls are fine; for contended counters under
real concurrency you need a lock the DAL doesn't provide.
Subtract from the number stored at this key (a missing key counts as 0).
How much to subtract.
The new total.
Same non-atomic read-modify-write caveat as KeyProxy.add.
Append one or more items to the array stored at this key (a missing key starts a new array).
Items to append.
The updated array.
Same non-atomic read-modify-write caveat as KeyProxy.add.
Prepend one or more items to the array stored at this key.
Items to prepend, kept in the given order.
The updated array.
Same non-atomic read-modify-write caveat as KeyProxy.add.
Remove & return the last item of the array stored at this key.
The removed item, or undefined if the array is empty or the key is missing.
A missing key is left missing => popping from nothing returns undefined without creating an
empty-array row. Same non-atomic read-modify-write caveat as KeyProxy.add.
Remove & return the first item of the array stored at this key.
The removed item, or undefined if the array is empty or the key is missing.
A missing key is left missing => shifting from nothing returns undefined without creating an
empty-array row. Same non-atomic read-modify-write caveat as KeyProxy.add.
Remove every element of the array that matches, and store what's left.
The array with the matches gone.
The value form is reference equality, so it won't match object elements => pass a predicate for
those. A missing key returns [] without creating a row. Same non-atomic read-modify-write
caveat as KeyProxy.add.
Terminal node of the fluent chain — bound to one
schema:table:keytriple. Returned by TableProxy.key.