summaryrefslogtreecommitdiff
path: root/ext/kv/01_db.ts
AgeCommit message (Collapse)Author
2024-09-19refactor(ext/kv): align error messages (#25500)Ian Bull
Towards https://github.com/denoland/deno/issues/25269
2024-08-20chore: enable no-console dlint rule (#25113)David Sherret
2024-05-23fix(runtime): use more null proto objects (#23921)Luca Casonato
This is a primordialization effort to improve resistance against users tampering with the global `Object` prototype. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-26refactor: migrate extensions to virtual ops module (#22135)Bartek Iwańczuk
First pass of migrating away from `Deno.core.ensureFastOps()`. A few "tricky" ones have been left for a follow up.
2024-01-10refactor: use `core.ensureFastOps()` (#21888)Kenta Moriuchi
2024-01-07fix(ext): enable prefer-primordials for internal TypeScript (#21813)Kenta Moriuchi
Enabled prefer-primordials lint for ext/cron and ext/kv.
2024-01-04fix: strict type check for cross realms (#21669)Kenta Moriuchi
Deno v1.39 introduces `vm.runInNewContext`. This may cause problems when using `Object.prototype.isPrototypeOf` to check built-in types. ```js import vm from "node:vm"; const err = new Error(); const crossErr = vm.runInNewContext(`new Error()`); console.assert( !(crossErr instanceof Error) ); console.assert( Object.getPrototypeOf(err) !== Object.getPrototypeOf(crossErr) ); ``` This PR changes to check using internal slots solves them. --- current: ``` > import vm from "node:vm"; undefined > vm.runInNewContext(`new Error("message")`) Error {} > vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`) Date {} ``` this PR: ``` > import vm from "node:vm"; undefined > vm.runInNewContext(`new Error("message")`) Error: message at <anonymous>:1:1 > vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`) 2018-12-10T02:26:59.002Z ``` --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-27perf: remove opAsync (#21690)Matt Mastracci
`opAsync` requires a lookup by name on each async call. This is a mechanical translation of all opAsync calls to ensureFastOps. The `opAsync` API on Deno.core will be removed at a later time.
2023-12-14feat(unstable): append commit versionstamp to key (#21556)Heyang Zhou
2023-12-12feat(ext/kv) add backoffSchedule to enqueue (#21474)Igor Zinkovsky
Also reduces the time to run `kv_queue_undelivered_test.ts` test from 100 seconds down to 3 seconds. closes #21437
2023-12-05fix(ext/kv): throw error if already closed (#21459)Raashid Anwar
If KV is closed and tries to listen queue should throw an error closes #20991
2023-12-05feat(unstable): kv.watch() (#21147)Luca Casonato
This commit adds support for a new `kv.watch()` method that allows watching for changes to a key-value pair. This is useful for cases where you want to be notified when a key-value pair changes, but don't want to have to poll for changes. --------- Co-authored-by: losfair <zhy20000919@hotmail.com>
2023-11-01feat: disposable Deno resources (#20845)Luca Casonato
This commit implements Symbol.dispose and Symbol.asyncDispose for the relevant resources. Closes #20839 --------- Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-09-26fix(kv_queues): graceful shutdown (#20627)Igor Zinkovsky
This fixes the `TypeError: Database closed` error during shutdown.
2023-09-22feat(kv_queues): increase max queue delay to 30 days (#20626)Igor Zinkovsky
2023-09-08fix(ext/kv): same `expireIn` should generate same `expireAt` (#20396)Heyang Zhou
Co-authored-by: Luca Casonato <hello@lcas.dev>
2023-08-18feat(ext/kv): key expiration (#20091)Heyang Zhou
Co-authored-by: Luca Casonato <hello@lcas.dev>
2023-07-01fix(ext/kv): expose Deno.AtomicOperation (#19674)Luca Casonato
2023-06-17chore(kv) fix and re-enable queue test (#19529)Igor Zinkovsky
The callback draining code is no longer needed after #19513.
2023-06-13feat(kv) queue implementation (#19459)Igor Zinkovsky
Extend the unstable `Deno.Kv` API to support queues.
2023-05-03fix(ext/kv): throw on the Kv constructor (#18978)Luca Casonato
Closes #18963 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-03fix(ext/kv): KvU64#valueOf and KvU64 inspect (#18656)Luca Casonato
`new Deno.KvU64(1n) + 2n == 3n` is now true. `new Deno.KvU64(1n)` is now inspected as `[Deno.KvU64: 1n]` (`Object(1n)` is inspected as `[BigInt: 1n]`). --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-04-29fix(ext/kv): stricter structured clone serializer (#18914)Luca Casonato
2023-04-27feat(kv): return ok bool from atomic commit (#18873)Luca Casonato
2023-04-26feat(ext/kv): add more atomic operation helpers (#18854)Ryan Dahl
Co-authored-by: losfair <zhy20000919@hotmail.com> Co-authored-by: Luca Casonato <hello@lcas.dev>
2023-04-25refactor(ext/kv): don't use bigint literals (#18841)Bartek Iwańczuk
This causes `DCHECK` fail in V8 when pointer compression is disabled.
2023-04-15feat(kv): AtomicOperation#sum (#18704)Ryan Dahl
2023-04-11fix(ext/kv): keys must be arrays (#18655)Luca Casonato
There was some leftover code from previous iterations, where keys could be single parts instead of arrays also. This didn't match the types.
2023-03-30fix(dts): improve types for the Deno.KV API (#18510)Luca Casonato
2023-03-30feat(ext/kv): return versionstamp from set/commit (#18512)Luca Casonato
This commit updates the `Deno.Kv` API to return the new commited versionstamp for the mutated data from `db.set` and `ao.commit`. This is returned in the form of a `Deno.KvCommitResult` object that has a `versionstamp` property.
2023-03-25chore(ext/kv): add limits (#18415)Heyang Zhou
2023-03-24fix(ext/kv): add missing `getMany` method (#18410)Heyang Zhou
The `getMany` method was missing from the implementation of the `Deno.Kv` class. This patch fixes it.
2023-03-22Revert "refactor: rename Deno.openKv() to Deno.kv() (#18349)" (#18362)Ryan Dahl
This reverts commit 50b793c9ed866ee29e8f04b4fa24b485b01a2b74.
2023-03-22refactor: rename Deno.openKv() to Deno.kv() (#18349)Ryan Dahl
2023-03-22feat(ext/kv): key-value store (#18232)Heyang Zhou
This commit adds unstable "Deno.openKv()" API that allows to open a key-value database at a specified path. --------- Co-authored-by: Luca Casonato <hello@lcas.dev> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>