MCPcopy Create free account
hub / github.com/erans/pgsqlite / parse_json_path

Function parse_json_path

src/functions/json_functions.rs:1221–1229  ·  view source on GitHub ↗

Parse PostgreSQL array path format '{key1,key2}' into Vec

(path_str: &str)

Source from the content-addressed store, hash-verified

1219
1220/// Parse PostgreSQL array path format '{key1,key2}' into Vec<String>
1221fn parse_json_path(path_str: &str) -> Vec<String> {
1222 let trimmed = path_str.trim();
1223 if trimmed.starts_with('{') && trimmed.ends_with('}') {
1224 let inner = &trimmed[1..trimmed.len()-1];
1225 inner.split(',').map(|s| s.trim().to_string()).collect()
1226 } else {
1227 vec![trimmed.to_string()]
1228 }
1229}
1230
1231/// Set value at path in JSON
1232fn set_json_value(json: &mut JsonValue, path: &[String], new_value: JsonValue) {

Callers 1

register_json_functionsFunction · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected