MCPcopy Create free account
hub / github.com/douglance/devsql / todo_json_to_data_row

Function todo_json_to_data_row

crates/ccql/src/sql/composite_storage.rs:368–393  ·  view source on GitHub ↗

Convert a todo JSON object to a DataRow

(
    json: &JsonValue,
    source_file: &str,
    workspace_id: &str,
    agent_id: &str,
)

Source from the content-addressed store, hash-verified

366
367/// Convert a todo JSON object to a DataRow
368fn todo_json_to_data_row(
369 json: &JsonValue,
370 source_file: &str,
371 workspace_id: &str,
372 agent_id: &str,
373) -> DataRow {
374 let mut map = BTreeMap::new();
375
376 map.insert(
377 "_source_file".to_string(),
378 Value::Str(source_file.to_string()),
379 );
380 map.insert(
381 "_workspace_id".to_string(),
382 Value::Str(workspace_id.to_string()),
383 );
384 map.insert("_agent_id".to_string(), Value::Str(agent_id.to_string()));
385
386 if let JsonValue::Object(obj) = json {
387 for (key, value) in obj {
388 map.insert(key.clone(), json_value_to_glue_value(value));
389 }
390 }
391
392 DataRow::Map(map)
393}
394
395/// Convert a codex jhistory JSON object to a normalized DataRow
396fn jhistory_json_to_data_row(json: &JsonValue) -> Option<DataRow> {

Callers 1

scan_todosMethod · 0.85

Calls 1

json_value_to_glue_valueFunction · 0.85

Tested by

no test coverage detected