Skip to content

Commit

Permalink
feat: upgrade to dwn-sdk-js 0.4.0
Browse files Browse the repository at this point in the history
fix: wipe existing data to ensure clean update
  • Loading branch information
enmand committed Jul 2, 2024
1 parent 20c70d5 commit c7f00b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions crates/dwn-rs-stores/src/surrealdb/data_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ impl DataStore for SurrealDB {

let len = self
.with_database(tenant, |db| async move {
db.delete::<Option<GetData>>(id.clone())
.await
.map_err(SurrealDBError::from)
.map_err(StoreError::from)?;

db.create::<Option<GetData>>(id.clone())
.content(CreateData {
cid: cid.to_string(),
Expand Down
2 changes: 1 addition & 1 deletion crates/dwn-rs-wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0-dev",
"type": "module",
"dependencies": {
"@tbd54566975/dwn-sdk-js": "0.3.10",
"@tbd54566975/dwn-sdk-js": "0.4.0",
"@types/readable-stream": "4.0.14",
"readable-stream": "4.5.2"
},
Expand Down
3 changes: 3 additions & 0 deletions crates/dwn-rs-wasm/tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
SurrealDataStore,
SurrealMessageStore,
SurrealEventLog,
SurrealResumableTaskStore,
} from "../pkg/index.js";
import WebSocket from "isomorphic-ws";

Expand All @@ -15,6 +16,8 @@ let d = new SurrealDataStore();
await d.connect("mem://");
let e = new SurrealEventLog();
await e.connect("mem://");
let t = new SurrealResumableTaskStore();
await t.connect("mem://");
describe("Store dependent tests", () => {
TestSuite.runInjectableDependentTests({
messageStore: s,
Expand Down

0 comments on commit c7f00b0

Please sign in to comment.