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

Function passes_through_json

nodedb-client/src/sql_escape/literal.rs:35–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33
34 #[test]
35 fn passes_through_json() {
36 // The metadata path renders sonic_rs JSON and then quotes it as
37 // a SQL string. JSON already escapes its own `"` and `\`, so
38 // only the outer `'` needs SQL escaping.
39 let json = r#"{"name":"O'Reilly","ok":true}"#;
40 let quoted = quote_string_literal(json);
41 assert_eq!(quoted, "'{\"name\":\"O''Reilly\",\"ok\":true}'");
42 }
43}

Callers

nothing calls this directly

Calls 1

quote_string_literalFunction · 0.85

Tested by

no test coverage detected