Skip to content

Commit

Permalink
feat(ext/kv): key-value store (#18232)
Browse files Browse the repository at this point in the history
This commit adds unstable "Deno.openKv()" API that allows to open
a key-value database at a specified path.

---------

Co-authored-by: Luca Casonato <[email protected]>
Co-authored-by: Bartek Iwańczuk <[email protected]>
  • Loading branch information
3 people committed Mar 22, 2023
1 parent 8bcffff commit 92ebf4a
Show file tree
Hide file tree
Showing 27 changed files with 3,831 additions and 2 deletions.
15 changes: 15 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 23,7 @@ members = [
"ext/fs",
"ext/http",
"ext/io",
"ext/kv",
"ext/net",
"ext/node",
"ext/url",
Expand Down Expand Up @@ -67,6 68,7 @@ deno_http = { version = "0.88.0", path = "./ext/http" }
deno_io = { version = "0.3.0", path = "./ext/io" }
deno_net = { version = "0.85.0", path = "./ext/net" }
deno_node = { version = "0.30.0", path = "./ext/node" }
deno_kv = { version = "0.1.0", path = "./ext/kv" }
deno_tls = { version = "0.80.0", path = "./ext/tls" }
deno_url = { version = "0.93.0", path = "./ext/url" }
deno_web = { version = "0.124.0", path = "./ext/web" }
Expand All @@ -91,6 93,7 @@ encoding_rs = "=0.8.31"
flate2 = "=1.0.24"
fs3 = "0.5.0"
futures = "0.3.21"
hex = "0.4"
http = "0.2.9"
hyper = "0.14.18"
indexmap = { version = "1.9.2", features = ["serde"] }
Expand Down
5 changes: 5 additions & 0 deletions cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 8,7 @@ use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;
use deno_runtime::deno_cache::SqliteBackedCache;
use deno_runtime::deno_kv::sqlite::SqliteDbHandler;
use deno_runtime::permissions::PermissionsContainer;
use deno_runtime::*;

Expand Down Expand Up @@ -353,6 354,10 @@ fn create_cli_snapshot(snapshot_path: PathBuf) {
None,
),
deno_tls::deno_tls::init_ops(),
deno_kv::deno_kv::init_ops(
SqliteDbHandler::<PermissionsContainer>::new(None),
false, // No --unstable.
),
deno_napi::deno_napi::init_ops::<PermissionsContainer>(),
deno_http::deno_http::init_ops(),
deno_io::deno_io::init_ops(Default::default()),
Expand Down
Loading

0 comments on commit 92ebf4a

Please sign in to comment.