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

Function extract_properties

nodedb-sql/src/ddl_ast/graph_parse/helpers.rs:116–125  ·  view source on GitHub ↗
(toks: &[Tok<'_>])

Source from the content-addressed store, hash-verified

114}
115
116pub(super) fn extract_properties(toks: &[Tok<'_>]) -> GraphProperties {
117 let Some(pos) = find_keyword(toks, "PROPERTIES") else {
118 return GraphProperties::None;
119 };
120 match toks.get(pos + 1) {
121 Some(Tok::Object(obj_str)) => GraphProperties::Object((*obj_str).to_string()),
122 Some(Tok::Quoted(s)) => GraphProperties::Quoted(s.clone().into_owned()),
123 _ => GraphProperties::None,
124 }
125}
126
127/// Extract `ARRAY[f1, f2, …]` that appears after `keyword` in raw SQL.
128///

Callers 1

parse_insert_edgeFunction · 0.85

Calls 4

to_stringMethod · 0.80
find_keywordFunction · 0.70
getMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected