Run task with a read cache for the configured database: while it runs, each file is read from storage once and
later reads of it are answered from memory, so a join no longer reads the joined record's files again for every row.
Writes and deletes made during the task update the cache (see cacheWrite, cacheRemove), so a query reads its own
writes. Outside any task nothing is cached and every read goes to storage, as before.
The cache holds text, not parsed objects: every read parses its own copy, so a caller changing what it read (a join
attaches rows to the rows it read) never changes what the next reader gets.
withDatabaseLock runs every public call (query, create, drop, describe) inside one, so the cache lasts one call. In
Node calls on one database never overlap (the lock queues them). In a browser they can, and a read can't tell which
call it belongs to, so each call that starts empties the cache: calls still running carry on (only reading their
files again), and nothing is older than the newest call, however long calls keep overlapping.
Run
taskwith a read cache for the configured database: while it runs, each file is read from storage once and later reads of it are answered from memory, so a join no longer reads the joined record's files again for every row. Writes and deletes made during the task update the cache (see cacheWrite, cacheRemove), so a query reads its own writes. Outside any task nothing is cached and every read goes to storage, as before.The cache holds text, not parsed objects: every read parses its own copy, so a caller changing what it read (a join attaches rows to the rows it read) never changes what the next reader gets.
withDatabaseLock runs every public call (query, create, drop, describe) inside one, so the cache lasts one call. In Node calls on one database never overlap (the lock queues them). In a browser they can, and a read can't tell which call it belongs to, so each call that starts empties the cache: calls still running carry on (only reading their files again), and nothing is older than the newest call, however long calls keep overlapping.