summaryrefslogtreecommitdiff
path: root/ext/kv/sqlite.rs
diff options
context:
space:
mode:
authorHeyang Zhou <zhy20000919@hotmail.com>2023-08-22 13:56:00 +0800
committerGitHub <noreply@github.com>2023-08-22 13:56:00 +0800
commit6d4a005e4108a5dd762b339a02bc4d802755ba0d (patch)
tree69679038bfbd3127f6c1e1b85dbc347c8c52e36e /ext/kv/sqlite.rs
parent5834d282d4de5d0b5cacb9bf068f3896bef0a48a (diff)
feat(ext/kv): connect to remote database (#20178)
This patch adds a `remote` backend for `ext/kv`. This supports connection to Deno Deploy and potentially other services compatible with the KV Connect protocol.
Diffstat (limited to 'ext/kv/sqlite.rs')
-rw-r--r--ext/kv/sqlite.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/kv/sqlite.rs b/ext/kv/sqlite.rs
index 8e37d2c87..bf2688920 100644
--- a/ext/kv/sqlite.rs
+++ b/ext/kv/sqlite.rs
@@ -724,6 +724,7 @@ impl Database for SqliteDb {
async fn snapshot_read(
&self,
+ _state: Rc<RefCell<OpState>>,
requests: Vec<ReadRange>,
_options: SnapshotReadOptions,
) -> Result<Vec<ReadRangeOutput>, AnyError> {
@@ -769,6 +770,7 @@ impl Database for SqliteDb {
async fn atomic_write(
&self,
+ _state: Rc<RefCell<OpState>>,
write: AtomicWrite,
) -> Result<Option<CommitResult>, AnyError> {
let write = Arc::new(write);
@@ -894,7 +896,10 @@ impl Database for SqliteDb {
Ok(commit_result)
}
- async fn dequeue_next_message(&self) -> Result<Self::QMH, AnyError> {
+ async fn dequeue_next_message(
+ &self,
+ _state: Rc<RefCell<OpState>>,
+ ) -> Result<Self::QMH, AnyError> {
let queue = self
.queue
.get_or_init(|| async move { SqliteQueue::new(self.conn.clone()) })