MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / upsert_updates_field

Function upsert_updates_field

nodedb/tests/engine_surface_document_strict.rs:65–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63
64#[tokio::test]
65async fn upsert_updates_field() {
66 let srv = TestServer::start().await;
67 srv.exec("CREATE TABLE strict_upsert (id TEXT PRIMARY KEY, status TEXT)")
68 .await
69 .unwrap();
70
71 srv.exec("INSERT INTO strict_upsert (id, status) VALUES ('u1', 'pending')")
72 .await
73 .unwrap();
74 srv.exec("UPSERT INTO strict_upsert (id, status) VALUES ('u1', 'done')")
75 .await
76 .unwrap();
77
78 let rows = srv
79 .query_rows("SELECT status FROM strict_upsert WHERE id = 'u1'")
80 .await
81 .unwrap();
82 assert_eq!(rows.len(), 1);
83 assert_eq!(rows[0][0], "done");
84}
85
86#[tokio::test]
87async fn delete_removes_row() {

Callers

nothing calls this directly

Calls 2

query_rowsMethod · 0.80
execMethod · 0.45

Tested by

no test coverage detected