- Update to work with Deno 2.0
- Fix missig awaits when closing file descriptor
- Ensure file is locked by the current process before writing anything
- Add parameter
ignoreTransactionErrors
toopen()
andsync()
. - Make cli
open
andopen:noindex
ignore errors by default. - Add cli command
repair
- Add optional parameter
ignoreReadErrors
to commandsopen
,sync
,scan
andvacuum
- Fix problem with murmurHash implementation
- Allow using different hashing algorithms per database version
- Makes cli tool
open
andclose
more resilient to errors. - Dependency update.
- Refactor of file locks during a vacuum
- Added
KV.defer(promiseToHandle, [errorHandler], [timeoutMs])
method to allow non-awaited promises to be tracked and settled duringKV.close()
.errorHandler
(optional): A function to handle errors that occur during promise resolution/rejection. If not provided, errors will silently ignored.timeoutMs
(optional): A timeout (in milliseconds) for promise resolution. If the promise doesn't settle within this time duringKV.close()
, a warning will be logged. Defaults to 5000ms.
- Fix cli tool not being able to open any database after a failed open
- Code refactors
- Added
KV.defer(promiseToHandle, [errorHandler], [timeoutMs])
method to allow non-awaited promises to be tracked and settled duringKV.close()
.errorHandler
(optional): A function to handle errors that occur during promise resolution/rejection. If not provided, errors will silently ignored.timeoutMs
(optional): A timeout (in milliseconds) for promise resolution. If the promise doesn't settle within this time duringKV.close()
, a warning will be logged. Defaults to 5000ms.
- Fix cli tool not being able to open any database after a failed open
- Code refactors
- Fix for Node.js; use
readline
instead of prompt
- Fix for Node.js not treating subarrays of buffers as expected
Breaking change, databases created using earlier versions is not compatible with 0.16.0 and up.
- Use 32 bit MurmurHash3 (from new dependency
npm:ohash
instead of SHA-1 for transaction integrity check, saving time and storage - Precalculate the Uint32Array of the transaction signature, improving performance
- Use CBOR-encoding of key instead of custom implementation, improving performance
- Avoid copying arraybuffers in certain situations
- Prefetch data on transaction read, severely reducing the number of disk reads
- Remove option doLock from
.sync()
- Remove unused code from
key.ts
- Add benchmark for getting data that does not exist
- Rename internal function
toAbsolutePath
totoNormalizedAbsolutePath
and clarify code with additional comments - Adds various missing test to reduce the risk for regression bugs
- Do not assume that the ledger is open for the full duration of each method call.
- Fix `isOpen´ to return false while closing the database
- Remove sync result
noop
as isn't used anywhere anymore. - Adds
fetchData
option toscan
. Setting this tofalse
enables faster retrieval of transaction metadata. - Change the
stats
cli command to use the new fast scan. - Fix ledgerPath not being reset on close.
- Adds missing commands to the cli
help
output. - Remove
a.bridge() // this is bridge
-comments
- Fixed Deno panic on decoding data from cache
- Do not freeze the database during vacuum
- Reduce time in locked state during vacuum
- Only unlock old ledger after successful vacuum
- Only re-open ledger after successful vacuum
- Fixed Deno panic on decoding data from cache
- Fixed order of transactions returned by
iterate
andlistAll
- Add argument
reverse
toiterate
andlistAll
to allow almost instant queries for "last x transactions matching query y". - Reduce lock time on writing new transactions.
- Optimize the logic of writing new transactions.
- Make sure the results of
iterate
andlistAll
are returned in insertion order, or reverse insertion order ifreverse
is set.
- Fix for
prompt
totally blocking the event loop in the cli tool, preventing synchronization. - Make the watchdog slightly more invincible.
- Internal fix; Always unblock sync even if a vacuum fails
- Added
sync
cli command, to force a synchronization of the cli instance.
- Fixed a problem where records were overwritten during large atomic transaction writes.
- Renamed the CLI command
sysinfo
tostats
and added ledger statistics. - Added a constant factor
LEDGER_CACHE_MEMORY_FACTOR
to approximate the actual memory used by the ledger cache, based on raw data size. - Added a
recursive
option to.scan()
to allow recursively counting transactions in the ledger. - Improved error handling in cli commands.
- Increase
LOCK_STALE_TIMEOUT_MS
from 60 seconds to 3 hours, to allow longer running queries. - Fixed error where ledger was unlocked instantly after a failed locking operation.
- Added
unlock
-command to the cli interface, to allow manually unlocking a database from a crashed process.
- Fixed problem where keys lingered when running .listKeys() after a deletion.
- Adds
vacuum
cli command - Fixes missing await in
.scan()
- Added in-memory cache for ledger
- Added option
disableIndex
for faster startup in scenarios where you don't have to query the index. - Added option
ledgerCacheSize
to control how much of the ledger to cache in memory, for faster retrieval. - Refactor of cli tool
- Added command
open:noindex
to cli-tool. - Added the
.scan()
method to extract full transaction history for a certain key.
- Cli-tool
ckv
now included in@cross/kv
through export@cross/kv/cli
- Install with
deno install -A -g -n ckv jsr:@cross/kv/cli
and runckv
- Run without installing with
deno run -A jsr:@cross/kv/cli
- Install with
- Renamed
key.toStringRepresentation()
to.stringify()
- Added static function
KVKeyImplementation.parse()
which returns aKVKey
. - Various internal optiomizations
- Be more graceful when closing
- Allow unlocking the database while closing it.
- Only throw in
.sync()
on closed database if the force parameter is true. - Make all relevant methods (
.get()
,.set()
,.iterate()
,.listAll()
...) type safe using generics - Update docs
- Add method
.isOpen()
- Use a header flag instead of separate file to lock/unlock database
- Update ledger version
B011
->B012
with backwards compatibility - Implement atomic transactions
- Update ledger version
BETA
->B011
"Beta 0.11" - Use the supplied database path without adding
.data
- Reduce header length from 1024 to 256 bytes
- Add feature
.watch(query, callback, recursive)
- Change lockfile name from
path/to/db.lock
topath/to/db-lock
- Change temporary name from
path/to/db.tmp
topath/to/db-tmp
- Allow all unicode letters and numbers in string key parts
- Add
CHANGELOG.md
- Code cleanup