Select a key within this table.
The lookup key (e.g. guild_123).
Stream every key in this table, in ascending id order.
Optionalopts: ScanOptions
Optional ScanOptions => prefix narrows to ids that start with it.
An async iterator of ids => for await (const id of table.keys()).
Streaming on purpose (SC2): rows arrive one at a time (a cursor on SQLite, keyset-paged on
Postgres), so a scan of a 100k-row table never lands the whole thing in RAM. break out of the
loop early & the underlying cursor is released.
Reads committed rows straight from the engine => a write still sitting in the collector buffer
is not visible here yet (unlike KeyProxy.get, which peeks the buffer). Enumerate
from a quiesced state, or await/.force() the writes you care about first, for an exact view.
Stream every value in this table, in ascending id order.
Expected shape of the stored values.
Optionalopts: ScanOptions
Optional ScanOptions => prefix narrows to ids that start with it.
An async iterator of values.
Same streaming & buffer-visibility contract as TableProxy.keys.
Stream every [id, value] pair in this table, in ascending id order.
Expected shape of the stored values.
Optionalopts: ScanOptions
Optional ScanOptions => prefix narrows to ids that start with it.
An async iterator of [id, value] tuples (destructure like Map entries).
Same streaming & buffer-visibility contract as TableProxy.keys.
Stream [id, value] pairs for every key whose id starts with prefix.
Sugar for TableProxy.entries with { prefix }. The prefix is matched exactly & case
sensitively, bound as a parameter, never as a pattern => %/_/* in it match themselves.
Expected shape of the stored values.
Exact id prefix to match.
Count the rows in this table.
Optionalopts: ScanOptions
Optional ScanOptions => prefix counts only ids that start with it.
The row total as a plain number (counted in the database, rows are never materialized).
Counts committed rows => same buffer-visibility caveat as TableProxy.keys.
Delete every key in this table (or just those under a prefix).
Optionalopts: ScanOptions
Optional ScanOptions => prefix restricts the wipe to matching ids.
Scales linearly => it lists the matching ids (streamed, so the id list is the only thing held,
never the values) then deletes them one at a time through the same path as
KeyProxy.delete, so a queued set() on a deleted key can't resurrect it. On a huge
table that's a delete per row; it's a maintenance/reset operation, not a hot path.
Only clears rows already committed to the engine plus their buffered copies => a brand new
key still sitting unflushed in the collector (never written to disk) isn't seen by the scan.
Flush first (await/.force() or close()) if you need it gone too.
Table-level node of the fluent chain. Returned by SchemaProxy.table.